espnet2.s2st.losses.tacotron_loss.S2STTacotron2Loss
Less than 1 minute
espnet2.s2st.losses.tacotron_loss.S2STTacotron2Loss
class espnet2.s2st.losses.tacotron_loss.S2STTacotron2Loss(weight: float = 1.0, loss_type: str = 'L1+L2', use_masking: str2bool = True, use_weighted_masking: str2bool = False, bce_pos_weight: float = 20.0)
Bases: AbsS2STLoss
Tacotron-based loss for S2ST.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(after_outs: Tensor, before_outs: Tensor, logits: Tensor, ys: Tensor, labels: Tensor, olens: Tensor)
Forward.
- Parameters:
- after_outs (Tensor) – Batch of outputs after postnets (B, Lmax, odim).
- before_outs (Tensor) – Batch of outputs before postnets (B, Lmax, odim).
- logits (Tensor) – Batch of stop logits (B, Lmax).
- ys (Tensor) – Batch of padded target features (B, Lmax, odim).
- labels (LongTensor) – Batch of the sequences of stop token labels (B, Lmax).
- olens (LongTensor) – Batch of the lengths of each target (B,).
- Returns: L1 loss value. Tensor: Mean square error loss value. Tensor: Binary cross entropy loss value.
- Return type: Tensor