nussl/separation/base/nmf_mixin.py
def inverse_transform(components, activations):
        """
        Reconstructs the magnitude spectrogram by matrix multiplying the components 
        with the activations. Components and activations are considered to be 2D matrices, 
        but if they are more, then the first dimension is interpreted to be the batch 
        dimension.
        
        Args:
            components (np.ndarray): Spectral templates (n_components, n_features)
            activations (np.ndarray): Activations (n_components, n_time, n_channels)
              The shape here is as if it was like an STFT but with components as the
              features rather than frequencies of the STFT.
        """
        activations = activations.transpose()
        shape = activations.shape

        reconstruction = activations @ components
        reconstruction = reconstruction.reshape(shape[:-1] + (-1,))

        return reconstruction.transpose()

        Reconstructs the magnitude spectrogram by matrix multiplying the components 
        with the activations. Components and activations are considered to be 2D matrices, 
        but if they are more, then the first dimension is interpreted to be the batch 
        dimension.
        
        Args:
            components (np.ndarray): Spectral templates (n_components, n_features)
            activations (np.ndarray): Activations (n_components, n_time, n_channels)
              The shape here is as if it was like an STFT but with components as the
              features rather than frequencies of the STFT.
        
Reconstructs the magnitude spectrogram by matrix multiplying the components
with the activations. Components and activations are considered to be 2D matrices,
but if they are more, then the first dimension is interpreted to be the batch
dimension.
Reconstructs the magnitude spectrogram by matrix multiplying the components with the activations . Components and activations are considered to be 2D matrices but if they are more then the first dimension is interpreted to be the batch dimension .
def inverse_transform(components, activations):
        activations = activations.transpose()
        shape = activations.shape
        reconstruction = activations @ components
        reconstruction = reconstruction.reshape(shape[:-1] + (-1,))
        return reconstruction.transpose()
def inverse_transform ( components , activations ) : activations = activations . transpose ( ) shape = activations . shape reconstruction = activations @ components reconstruction = reconstruction . reshape ( shape [ : - 1 ] + ( - 1 , ) ) return reconstruction . transpose ( )
Reconstructs the magnitude spectrogram by matrix multiplying the components
with the activations.
Reconstructs the magnitude spectrogram by matrix multiplying the components with the activations .
"""
        Reconstructs the magnitude spectrogram by matrix multiplying the components 
        with the activations. Components and activations are considered to be 2D matrices, 
        but if they are more, then the first dimension is interpreted to be the batch 
        dimension.
        
        Args:
            components (np.ndarray): Spectral templates (n_components, n_features)
            activations (np.ndarray): Activations (n_components, n_time, n_channels)
              The shape here is as if it was like an STFT but with components as the
              features rather than frequencies of the STFT.
        """
components
Spectral templates (n_components, n_features)
Spectral templates ( n_components n_features )
activations
Activations (n_components, n_time, n_channels)
The shape here is as if it was like an STFT but with components as the
features rather than frequencies of the STFT.
Activations ( n_components n_time n_channels ) The shape here is as if it was like an STFT but with components as the features rather than frequencies of the STFT .