Skip to content

Commit

Permalink
ch4
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed Apr 25, 2022
1 parent 7b4422a commit a4e253a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 04_mnist_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3887,7 +3887,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's see what the change in accuracy is for a small change in one of the weights:"
"Now let's see what the change in accuracy is for a small change in one of the weights (note that we have to ask PyTorch not to calculate gradients as we do this, which is what `with torch.no_grad()` is doing here):"
]
},
{
Expand All @@ -3896,7 +3896,7 @@
"metadata": {},
"outputs": [],
"source": [
"weights[0] *= 1.0001"
"with torch.no_grad(): weights[0] *= 1.0001"
]
},
{
Expand Down

0 comments on commit a4e253a

Please sign in to comment.