Skip to content

improve readability of the cifar10 blitz tutorial code #849

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

Merged
merged 5 commits into from
Apr 26, 2021

Conversation

wAuner
Copy link
Contributor

@wAuner wAuner commented Feb 13, 2020

When I was working through the blitz cifar 10 tutorial it took me quite some time to understand the evaluation logic of the per-class accuracy.
I've added some code comments and rewrote this small part to make it much more obvious what is going on. Generally I've tried to replace the ranges with fixed numbers for batchsize or classes with speaking names.
In detail:

  • now using dicts with classnames as keys to collect classifications, instead of lists which map to class by index
  • implicitly removed an unneccessary squeeze operation diffline271
  • removed the unexplained reference to the batchsize (hardcoded int)
  • make the counting of the correct predictions per class more readable

@wAuner wAuner changed the title add code comments and test code readability++ improve readability for the cifar10 blitz tutorial code Feb 13, 2020
@wAuner wAuner changed the title improve readability for the cifar10 blitz tutorial code improve readability of the cifar10 blitz tutorial code Feb 13, 2020
@netlify
Copy link

netlify bot commented Feb 13, 2020

Deploy preview for pytorch-tutorials-preview ready!

Built with commit 84ef498

https://deploy-preview-849--pytorch-tutorials-preview.netlify.com

@netlify
Copy link

netlify bot commented Feb 13, 2020

Deploy preview for pytorch-tutorials-preview ready!

Built with commit ca8fb70

https://deploy-preview-849--pytorch-tutorials-preview.netlify.app

Base automatically changed from master to main February 16, 2021 19:33
Base automatically changed from main to master February 16, 2021 19:37
@holly1238 holly1238 requested review from subramen and ranman April 20, 2021 15:22
@facebook-github-bot
Copy link
Contributor

Hi @wAuner!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

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 cla@fb.com. Thanks!

@holly1238
Copy link
Contributor

Hi @wAuner! Can you sign the CLA agreement so that I can merge the pull request? Thanks!

@wAuner
Copy link
Contributor Author

wAuner commented Apr 22, 2021

@holly1238 if it's not some 100 page document written in legal Klingon, then yes 😄

@wAuner
Copy link
Contributor Author

wAuner commented Apr 26, 2021

@holly1238 ok I've signed that cla. Maybe the check needs to be triggered again

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@holly1238 holly1238 merged commit e18d233 into pytorch:master Apr 26, 2021
rodrigo-techera pushed a commit to Experience-Monks/tutorials that referenced this pull request Nov 29, 2021
Co-authored-by: holly1238 <77758406+holly1238@users.noreply.github.com>
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