espnet.nets.pytorch_backend.e2e_tts_fastspeech.FeedForwardTransformerLoss
Less than 1 minute
espnet.nets.pytorch_backend.e2e_tts_fastspeech.FeedForwardTransformerLoss
class espnet.nets.pytorch_backend.e2e_tts_fastspeech.FeedForwardTransformerLoss(use_masking=True, use_weighted_masking=False)
Bases: Module
Loss function module for feed-forward Transformer.
Initialize feed-forward Transformer loss module.
- Parameters:
- use_masking (bool) – Whether to apply masking for padded part in loss calculation.
- use_weighted_masking (bool) – Whether to weighted masking in loss calculation.
forward(after_outs, before_outs, d_outs, ys, ds, ilens, 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).
- d_outs (Tensor) – Batch of outputs of duration predictor (B, Tmax).
- ys (Tensor) – Batch of target features (B, Lmax, odim).
- ds (Tensor) – Batch of durations (B, Tmax).
- ilens (LongTensor) – Batch of the lengths of each input (B,).
- olens (LongTensor) – Batch of the lengths of each target (B,).
- Returns: L1 loss value. Tensor: Duration predictor loss value.
- Return type: Tensor