kaira.losses.audio.STFTLoss

Inheritance diagram for STFTLoss
- class kaira.losses.audio.STFTLoss(fft_size=1024, hop_size=256, win_length=1024, window='hann')[source]
Bases:
BaseLossSTFT Loss Module.
This module calculates the STFT loss between the input and target audio signals, combining spectral convergence loss and log STFT magnitude loss.
Methods
Initialize the STFTLoss module.
Forward pass through the STFTLoss module.
- __init__(fft_size=1024, hop_size=256, win_length=1024, window='hann')[source]
Initialize the STFTLoss module.
- forward(x: Tensor, target: Tensor) Tensor[source]
Forward pass through the STFTLoss module.
- Parameters:
x (torch.Tensor) – The input audio tensor.
target (torch.Tensor) – The target audio tensor.
- Returns:
The combined STFT loss.
- Return type: