espnet.utils.spec_augment.freq_mask
Less than 1 minute
espnet.utils.spec_augment.freq_mask
espnet.utils.spec_augment.freq_mask(spec, F=30, num_masks=1, replace_with_zero=False)
Frequency masking.
- Parameters:
- spec (torch.Tensor) – input tensor with shape (T, dim)
- F (int) – maximum width of each mask
- num_masks (int) – number of masks
- replace_with_zero (bool) – if True, masked parts will be filled with 0, if False, filled with mean