espnet2.asr.specaug.specaug.SpecAug
espnet2.asr.specaug.specaug.SpecAug
class espnet2.asr.specaug.specaug.SpecAug(apply_time_warp: bool = True, time_warp_window: int = 5, time_warp_mode: str = 'bicubic', apply_freq_mask: bool = True, freq_mask_width_range: int | Sequence[int] = (0, 20), num_freq_mask: int = 2, apply_time_mask: bool = True, time_mask_width_range: int | Sequence[int] | None = None, time_mask_width_ratio_range: float | Sequence[float] | None = None, num_time_mask: int = 2, replace_with_zero: bool = True)
Bases: AbsSpecAug
Implementation of SpecAug.
Reference: : Daniel S. Park et al. “SpecAugment: A Simple Data <br/>
Augmentation Method for Automatic Speech Recognition”
WARNING
When using cuda mode, time_warp doesn’t have reproducibility due to torch.nn.functional.interpolate.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(x, x_lengths=None)
Defines the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.