kaira.losses.audio.SpectralConvergenceLoss

Inheritance diagram of SpectralConvergenceLoss

Inheritance diagram for SpectralConvergenceLoss

class kaira.losses.audio.SpectralConvergenceLoss[source]

Bases: BaseLoss

Spectral Convergence Loss Module.

This module calculates the spectral convergence loss between the input and target spectra.

Methods

__init__

Initialize the SpectralConvergenceLoss module.

forward

Forward pass through the SpectralConvergenceLoss module.

__init__()[source]

Initialize the SpectralConvergenceLoss module.

forward(x_mag: Tensor, target_mag: Tensor) Tensor[source]

Forward pass through the SpectralConvergenceLoss module.

Parameters:
  • x_mag (torch.Tensor) – The magnitude of the input spectrum.

  • target_mag (torch.Tensor) – The magnitude of the target spectrum.

Returns:

The spectral convergence loss.

Return type:

torch.Tensor