pytorch / pytorch/tutorials

NN blitz tutorial: some small improvements

Open
#533 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

60_min_blitz
Dominant language
Python
Stars
9.3k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
4

Description

I had some small suggestions for
https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html

  • before the picture of the neural net, mention this is the famous "LeNet" example (and maybe give reference)

  • explain that the constructor only contains the layers with adjustable parameters,
    and the deterministic layers only appear in forward()

  • print(len(params)) gives the answer 10, but there are only 5 parameter blocks. Explain that the bias terms are treated separately.

  • "net.zero_grad(); out.backward(torch.randn(1, 10))" does not print anything, which makes one think there is something wrong. How about adding "print(params[1].grad)" and explain this is the gradient of the loss (evalyated at a random target vector) wrt the first layer bias vector.

  • The comment about batches should come before the statement "input = torch.randn(1, 1, 32, 32)" otherwise that is unclear

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the neural networks tutorial at https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html and review each of the five suggested clarifications. Update the explanations and example ordering, add visible gradient output, and confirm the tutorial renders and the examples remain understandable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.