espnet2.svs.naive_rnn.naive_rnn.NaiveRNNLoss
Less than 1 minute
espnet2.svs.naive_rnn.naive_rnn.NaiveRNNLoss
class espnet2.svs.naive_rnn.naive_rnn.NaiveRNNLoss(use_masking=True, use_weighted_masking=False)
Bases: Module
Loss function module for Tacotron2.
Initialize Tactoron2 loss module.
- Parameters:
- use_masking (bool) – Whether to apply masking for padded part in loss calculation.
- use_weighted_masking (bool) – Whether to apply weighted masking in loss calculation.
forward(after_outs, before_outs, ys, olens)
Calculate forward propagation.
- Parameters:
- after_outs (Tensor) – Batch of outputs after postnets (B, Lmax, odim).
- before_outs (Tensor) – Batch of outputs before postnets (B, Lmax, odim).
- ys (Tensor) – Batch of padded target features (B, Lmax, odim).
- olens (LongTensor) – Batch of the lengths of each target (B,).
- Returns: L1 loss value. Tensor: Mean square error loss value.
- Return type: Tensor