tnmf.backends.NumPy_FFT
¶
A module that provides a NumPy based backend for computing the gradients of the factorization model.
Shift-invariance is implemented via fast convolution in the Fourier domain using scipy.fft.rfftn()
and scipy.fft.irfftn()
.
Module Contents¶
Classes¶
A NumPy based backend that performs convolutions and contractions for computing the gradients of the factorization model |
-
class
tnmf.backends.NumPy_FFT.
NumPy_FFT_Backend
(**kwargs)¶ Bases:
tnmf.backends._NumPyFFTBackend.NumPyFFTBackend
A NumPy based backend that performs convolutions and contractions for computing the gradients of the factorization model via FFT:
Arrays to be convolved are transformed to Fourier space, multiplied and accumulated across the free indices (e.g. for the sum over all atoms in the reconstruction), and transformed back to coordinate space.
-
reconstruction_gradient_W
(self, V: numpy.ndarray, W: numpy.ndarray, H: numpy.ndarray, s: slice = sliceNone) → Tuple[numpy.ndarray, numpy.ndarray]¶
-
reconstruction_gradient_H
(self, V: numpy.ndarray, W: numpy.ndarray, H: numpy.ndarray, s: slice = sliceNone) → Tuple[numpy.ndarray, numpy.ndarray]¶
-
reconstruct
(self, W: numpy.ndarray, H: numpy.ndarray) → numpy.ndarray¶
-