tnmf.backends.NumPy

A module that provides a NumPy based backend for computing the gradients of the factorization model. Shift-invariance is implemented via explicit convolution operations in the coordinate space.

Module Contents

Classes

NumPy_Backend

A plain NumPy backend for computing the gradients of the factorization model in coordinate space (no FFT, no PyTorch).

class tnmf.backends.NumPy.NumPy_Backend(reconstruction_mode: str = 'valid')

Bases: tnmf.backends._NumPyBackend.NumPyBackend

A plain NumPy backend for computing the gradients of the factorization model in coordinate space (no FFT, no PyTorch).

Convolutions are computed efficiently as contractions of properly strided arrays.

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