Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions beginner_source/nn_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@
# gradient. This causes PyTorch to record all of the operations done on the tensor,
# so that it can calculate the gradient during back-propagation *automatically*!
#
# For the weights, we set ``requires_grad`` **after** the initialization, since we
# don't want that step included in the gradient. (Note that a trailing ``_`` in
# PyTorch signifies that the operation is performed in-place.)
# We set ``requires_grad`` **after** the initialization math. If enabled earlier,
# PyTorch would view the weights as the result of a calculation (non-leaf) rather
# than a source parameter, making them impossible to optimize. (Note that a trailing
# ``_`` in PyTorch signifies that the operation is performed in-place.)
#
# .. note:: We are initializing the weights here with
# `Xavier initialisation <http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf>`_
Expand Down
Loading