espnet.utils.spec_augment.time_mask
Less than 1 minute
espnet.utils.spec_augment.time_mask
espnet.utils.spec_augment.time_mask(spec, T=40, num_masks=1, replace_with_zero=False)
Time masking.
- Parameters:
- spec (torch.Tensor) – input tensor with shape (T, dim)
- T (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