Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/source/_static/img/specaugment-freq.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/specaugment-time.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions torchaudio/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ def forward(self, specgram: Tensor, mask_value: float = 0.) -> Tensor:
class FrequencyMasking(_AxisMasking):
r"""Apply masking to a spectrogram in the frequency domain.

In the image below, a frequency band has been masked on a spectrogram.
.. image:: _static/img/specaugment-freq.jpg

Args:
freq_mask_param (int): maximum possible length of the mask.
Indices uniformly sampled from [0, freq_mask_param).
Expand All @@ -835,6 +838,9 @@ def __init__(self, freq_mask_param: int, iid_masks: bool = False) -> None:
class TimeMasking(_AxisMasking):
r"""Apply masking to a spectrogram in the time domain.

In the image below, a time band has been masked on a spectrogram.
.. image:: _static/img/specaugment-time.jpg

Args:
time_mask_param (int): maximum possible length of the mask.
Indices uniformly sampled from [0, time_mask_param).
Expand Down