espnet.nets.pytorch_backend.tacotron2.cbhg.CBHGLoss
Less than 1 minute
espnet.nets.pytorch_backend.tacotron2.cbhg.CBHGLoss
class espnet.nets.pytorch_backend.tacotron2.cbhg.CBHGLoss(use_masking=True)
Bases: Module
Loss function module for CBHG.
Initialize CBHG loss module.
- Parameters:use_masking (bool) – Whether to mask padded part in loss calculation.
forward(cbhg_outs, spcs, olens)
Calculate forward propagation.
- Parameters:
- cbhg_outs (Tensor) – Batch of CBHG outputs (B, Lmax, spc_dim).
- spcs (Tensor) – Batch of groundtruth of spectrogram (B, Lmax, spc_dim).
- olens (LongTensor) – Batch of the lengths of each sequence (B,).
- Returns: L1 loss value Tensor: Mean square error loss value.
- Return type: Tensor