Univnet loss
UnivnetLoss
Bases: Module
UnivnetLoss is a PyTorch Module that calculates the generator and discriminator losses for Univnet.
Source code in training/loss/univnet_loss.py
__init__()
Initializes the UnivnetLoss module.
Source code in training/loss/univnet_loss.py
forward(audio, fake_audio, res_fake, period_fake, res_real, period_real)
Calculate the losses for the generator and discriminator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
audio |
Tensor
|
The real audio samples. |
required |
fake_audio |
Tensor
|
The generated audio samples. |
required |
res_fake |
List[Tuple[Tensor, Tensor]]
|
The discriminator's output for the fake audio. |
required |
period_fake |
List[Tuple[Tensor, Tensor]]
|
The discriminator's output for the fake audio in the period. |
required |
res_real |
List[Tuple[Tensor, Tensor]]
|
The discriminator's output for the real audio. |
required |
period_real |
List[Tuple[Tensor, Tensor]]
|
The discriminator's output for the real audio in the period. |
required |
Returns:
Name | Type | Description |
---|---|---|
tuple |
Tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor]
|
A tuple containing the univnet loss, discriminator loss, STFT loss, score loss, ESR, SISDR, SNR and SDSDR losses. |