-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Readable Code for Audio Signal Visualization #2190
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
Conversation
PreviewPreview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com.Format and styleUse the TensorFlow docs notebook tools to format for consistent source diffs and lint for style:$ python3 -m pip install -U --user git+https://github.com/tensorflow/docsIf commits are added to the pull request, synchronize your local branch: git pull origin audio_change
|
Thanks - I like your suggestion, but some of these variables are there to improve readability, so I have some requests:
|
Hi @markmcd, Thank you for the review. By code readable, I mainly meant simplifying |
Also, no need to mention |
"cols = 3\n", | ||
"n = rows * cols\n", | ||
"for i in range(n):\n", | ||
" plt.subplot(3, 3, i+1)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" plt.subplot(3, 3, i+1)\n", | |
" plt.subplot(rows, cols, i+1)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to miss this out. I shall update it
@MarkDaoust, I updated (3, 3) to (rows, cols). Sorry, I didn't notice that you already reviewed the PR |
@lucifertrj I formatted the notebook for you again, given the large diff because of the meta data. TODO for you:
This guide here explains how apply the TL;DR suggested steps:
The output should then say:
Then you can If you have questions, feel free to ask 👍 |
Hi @8bitmp3, I apologise for taking a two days gap. I was busy with my internship work. I will complete the TODO assigned to this PR tomorrow without fail. |
Done @8bitmp3 |
The following code does nothing in the simple audio documentation, and train_ds.take(1) doesn't require a break. Because this will return just a single batch/ for example_spectrograms, example_spect_labels in train_spectrogram_ds.take(1):
break The above code can be modified into the following: for example_spectrograms, example_spect_labels in train_spectrogram_ds.take(1):
print(example_spectrograms.shape)
print(example_spect_labels.shape) Should I make the changes, let me know what you think. |
This code does do something - try removing it, restarting and running the notebook to see what happens. You can see in the next cell that Another way this could be written that might avoid this confusion is: example_spectrograms, example_spect_labels = next(train_spectrogram_ds.take(1)) This is pretty explicit about what's happening, but |
Got it thanks |
@8bitmp3 , the PR is still showing |
I think that also needs an |
Thanks. LGTM. |
The following code takes to many variables, and I have simplified the following code into more readable format.
to