Skip to content

Conversation

@vincentqb
Copy link
Contributor

@vincentqb vincentqb commented Oct 21, 2020

Adding images to docstring to illustrate SpecAugment added in #285 as suggested by moto. This could look good online?

specaugment_freq
specaugment_time

To regenerate:

import torchaudio

filename = "steam-train-whistle-daniel_simon.wav"
waveform, sample_rate = torchaudio.load(filename)
specgram = torchaudio.transforms.Spectrogram(n_fft=1054)(waveform)

augmentations = torchaudio.transforms.TimeMasking(time_mask_param=100)
augmented = augmentations(specgram[0, ...].log())
plt.imshow(augmented.numpy(), cmap='gray');
# plt.axis('off')
plt.savefig('specaugment_time.jpg')

augmentations = torchaudio.transforms.FrequencyMasking(freq_mask_param=100)
augmented = augmentations(specgram[0, ...].log())
plt.imshow(augmented.numpy(), cmap='gray');
# plt.axis('off')
plt.savefig('specaugment_freq.jpg')

@vincentqb vincentqb changed the title add image for specaugment docstring. add image for specaugment docstring Oct 21, 2020
@cpuhrsch
Copy link
Contributor

I'd add to the description a line describing the motivation behind this change.

@vincentqb
Copy link
Contributor Author

vincentqb commented Oct 26, 2020

Image in docstring in pytorch, or here

@cpuhrsch
Copy link
Contributor

I think it's fine if the docstring can still stand by itself and the images are supplemental

@mthrok
Copy link
Contributor

mthrok commented Oct 26, 2020

I think it would look better with a colormap other than grayscale.

https://matplotlib.org/cmocean/

@cpuhrsch
Copy link
Contributor

On the color scheme: I'd play with it, but make sure it's still visible for people with color blindness and related

@facebook-github-bot
Copy link
Contributor

Hi @vincentqb!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@mthrok
Copy link
Contributor

mthrok commented Nov 3, 2021

Addressed by #1887

@mthrok mthrok closed this Nov 3, 2021
mpc001 pushed a commit to mpc001/audio that referenced this pull request Aug 4, 2023
… accuracy is incorrect. We solve this problem with an auxiliary validation set. (pytorch#980)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants