Skip to content

Commit

Permalink
Merge pull request #5803 from aky15/patch-6
Browse files Browse the repository at this point in the history
Update specaug.py
  • Loading branch information
sw005320 committed Jun 10, 2024
2 parents 1bbdf96 + 444d52a commit 128d307
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions espnet2/asr/specaug/specaug.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(
time_mask_width_range: Optional[Union[int, Sequence[int]]] = None,
time_mask_width_ratio_range: Optional[Union[float, Sequence[float]]] = None,
num_time_mask: int = 2,
replace_with_zero: bool = True,
):
if not apply_time_warp and not apply_time_mask and not apply_freq_mask:
raise ValueError(
Expand Down Expand Up @@ -62,6 +63,7 @@ def __init__(
dim="freq",
mask_width_range=freq_mask_width_range,
num_mask=num_freq_mask,
replace_with_zero=replace_with_zero,
)
else:
self.freq_mask = None
Expand All @@ -72,12 +74,14 @@ def __init__(
dim="time",
mask_width_range=time_mask_width_range,
num_mask=num_time_mask,
replace_with_zero=replace_with_zero,
)
elif time_mask_width_ratio_range is not None:
self.time_mask = MaskAlongAxisVariableMaxWidth(
dim="time",
mask_width_ratio_range=time_mask_width_ratio_range,
num_mask=num_time_mask,
replace_with_zero=replace_with_zero,
)
else:
raise ValueError(
Expand Down

0 comments on commit 128d307

Please sign in to comment.