espnet2.s2st.losses.attention_loss.S2STAttentionLoss
Less than 1 minute
espnet2.s2st.losses.attention_loss.S2STAttentionLoss
class espnet2.s2st.losses.attention_loss.S2STAttentionLoss(vocab_size: int, padding_idx: int = -1, weight: float = 1.0, smoothing: float = 0.0, normalize_length: str2bool = False, criterion: Module = KLDivLoss())
Bases: AbsS2STLoss
attention-based label smoothing loss for S2ST.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(dense_y: Tensor, token_y: Tensor)
Forward.
Args: