Skip to content

Commit

Permalink
Correct ch.4 MNIST: set threshold to 0.0 when not using sigmoid (fast…
Browse files Browse the repository at this point in the history
…ai#461)

* Correct ch.4 MNIST: set threshold to 0.0 when not using sigmoid

* Also change 0.5 to 0.0 in the text

Co-authored-by: Ben van der Burgh <ben@metabolic.nl>
  • Loading branch information
benjaminvdb and Ben van der Burgh authored Apr 25, 2022
1 parent e170b69 commit b87a476
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 @@ -3833,7 +3833,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's check our accuracy. To decide if an output represents a 3 or a 7, we can just check whether it's greater than 0.5, so our accuracy for each item can be calculated (using broadcasting, so no loops!) with:"
"Let's check our accuracy. To decide if an output represents a 3 or a 7, we can just check whether it's greater than 0.0, so our accuracy for each item can be calculated (using broadcasting, so no loops!) with:"
]
},
{
Expand All @@ -3859,7 +3859,7 @@
}
],
"source": [
"corrects = (preds>0.5).float() == train_y\n",
"corrects = (preds>0.0).float() == train_y\n",
"corrects"
]
},
Expand Down

0 comments on commit b87a476

Please sign in to comment.