Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential SpectrogramDrop bugs #2542

Open
asumagic opened this issue May 7, 2024 · 0 comments
Open

Potential SpectrogramDrop bugs #2542

asumagic opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@asumagic
Copy link
Collaborator

asumagic commented May 7, 2024

Describe the bug

It would probably worth sanity checking the SpectrogramDrop code (and others) for issues, and to be careful in the reading of the reference papers (I haven't checked yet). I noticed some odd code:

mask_pos = torch.randint(
    0,
    max(1, D, -mask_len.max()),
    (batch_size, n_masks),
    device=spectrogram.device,
).unsqueeze(2)
  • The max() statement seems wrong, as the -mask_len.max() value will always be negative and disregarded. Thus, a given frequency mask application might mask much fewer bins than selected with drop_length_low/high if it starts near the top of the frequency range. e.g. if it starts at the 5th highest frequency bin it would only mask 5 bins. This might be OK.
  • Opposite problem at the low end: since the mask_pos is a starting position, the lowest frequency bins are significantly less likely to get masked than the bins in the middle of the spectrogram. e.g. the lowest frequency bin has a 1/D chance of being masked, and so on. This might slightly harm the benefits of SpecAugment?

Example of a few SpecAugment applications (including time-wise, ignore that):

bunch of SpecAug examples on real audio

Expected behaviour

Not sure! The proper behavior might be arguable, need to read some papers.

To Reproduce

No response

Environment Details

No response

Relevant Log Output

No response

Additional Context

No response

@asumagic asumagic added the bug Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant