espnet2.s2st.losses.guided_attention_loss.S2STGuidedAttentionLoss
Less than 1 minute
espnet2.s2st.losses.guided_attention_loss.S2STGuidedAttentionLoss
class espnet2.s2st.losses.guided_attention_loss.S2STGuidedAttentionLoss(weight: float = 1.0, sigma: float = 0.4, alpha: float = 1.0)
Bases: AbsS2STLoss
Tacotron-based loss for S2ST.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(att_ws: Tensor, ilens: Tensor, olens_in: Tensor)
Forward.
Args:
- Returns: guided attention loss
- Return type: Tensor