espnet2.uasr.loss.smoothness_penalty.UASRSmoothnessPenalty
Less than 1 minute
espnet2.uasr.loss.smoothness_penalty.UASRSmoothnessPenalty
class espnet2.uasr.loss.smoothness_penalty.UASRSmoothnessPenalty(weight: float = 1.0, reduction: str = 'none')
Bases: AbsUASRLoss
smoothness penalty for UASR.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(dense_logits: Tensor, dense_padding_mask: Tensor, sample_size: int, is_discriminative_step: bool)
Forward.
- Parameters:
- dense_logits – output logits of generator
- dense_padding_mask – padding mask of logits
- sample_size – batch size
- is_discriminative_step – Whether is training discriminator