espnet2.layers.mixup_augmentation.MixupAugment
Less than 1 minute
espnet2.layers.mixup_augmentation.MixupAugment
class espnet2.layers.mixup_augmentation.MixupAugment(mixup_probability: float)
Bases: Module
Mixup augmentation module for multi-label classification.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(speech: Tensor, onehot: Tensor, speech_lengths: Tensor)
Applies mixup augmentation.
- Parameters:
- speech – (Batch, Length)
- onehot – (Batch, n_classes)
- speech_lengths – (Batch,)
- Returns: (Batch, Length) onehot: (Batch, n_classes) speech_lengths: (Batch,): Minimum of the two lengths mixed.
- Return type: speech