espnet2.uasr.loss.phoneme_diversity_loss.UASRPhonemeDiversityLoss
Less than 1 minute
espnet2.uasr.loss.phoneme_diversity_loss.UASRPhonemeDiversityLoss
class espnet2.uasr.loss.phoneme_diversity_loss.UASRPhonemeDiversityLoss(weight: float = 1.0)
Bases: AbsUASRLoss
phoneme diversity loss for UASR.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(dense_x: Tensor, sample_size: int, is_discriminative_step: str2bool)
Forward.
- Parameters:
- dense_x – predicted logits of generated samples
- sample_size – batch size
- is_dicriminative_step – whether is training discriminator