espnet2.layers.mask_along_axis.MaskAlongAxisVariableMaxWidth
Less than 1 minute
espnet2.layers.mask_along_axis.MaskAlongAxisVariableMaxWidth
class espnet2.layers.mask_along_axis.MaskAlongAxisVariableMaxWidth(mask_width_ratio_range: float | Sequence[float] = (0.0, 0.05), num_mask: int = 2, dim: int | str = 'time', replace_with_zero: bool = True)
Bases: Module
Mask input spec along a specified axis with variable maximum width.
Formula: : max_width = max_width_ratio * seq_len
Initializes internal Module state, shared by both nn.Module and ScriptModule.
extra_repr()
Set the extra representation of the module
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
forward(spec: Tensor, spec_lengths: Tensor | None = None)
Forward function.
- Parameters:spec – (Batch, Length, Freq)