Skip to content

Commit

Permalink
max_num_masks is at least min_num_masks (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackTemaki authored Oct 12, 2023
1 parent aaa51af commit 48ade42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion i6_models/primitives/specaugment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
import torch


Expand Down Expand Up @@ -129,7 +130,7 @@ def specaugment_v1_by_length(
return specaugment_v1(
audio_features,
time_min_num_masks=time_min_num_masks,
time_max_num_masks=audio_features.size(1) // time_max_mask_per_n_frames,
time_max_num_masks=np.maximum(audio_features.size(1) // time_max_mask_per_n_frames, time_min_num_masks),
time_mask_max_size=time_mask_max_size,
freq_min_num_masks=freq_min_num_masks,
freq_max_num_masks=freq_max_num_masks,
Expand Down

0 comments on commit 48ade42

Please sign in to comment.