kaira.losses.audio.LogSTFTMagnitudeLoss

Inheritance diagram of LogSTFTMagnitudeLoss

Inheritance diagram for LogSTFTMagnitudeLoss

class kaira.losses.audio.LogSTFTMagnitudeLoss[source]

Bases: BaseLoss

Log STFT Magnitude Loss Module.

This module calculates the log STFT magnitude loss between the input and target spectra.

Methods

__init__

Initialize the LogSTFTMagnitudeLoss module.

forward

Forward pass through the LogSTFTMagnitudeLoss module.

__init__()[source]

Initialize the LogSTFTMagnitudeLoss module.

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

Forward pass through the LogSTFTMagnitudeLoss module.

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

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

Returns:

The log STFT magnitude loss.

Return type:

torch.Tensor