Skip to content

Commit b87a476

Browse files
benjaminvdbBen van der Burgh
andauthored
Correct ch.4 MNIST: set threshold to 0.0 when not using sigmoid (#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>
1 parent e170b69 commit b87a476

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

04_mnist_basics.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,7 +3833,7 @@
38333833
"cell_type": "markdown",
38343834
"metadata": {},
38353835
"source": [
3836-
"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:"
3836+
"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:"
38373837
]
38383838
},
38393839
{
@@ -3859,7 +3859,7 @@
38593859
}
38603860
],
38613861
"source": [
3862-
"corrects = (preds>0.5).float() == train_y\n",
3862+
"corrects = (preds>0.0).float() == train_y\n",
38633863
"corrects"
38643864
]
38653865
},

0 commit comments

Comments
 (0)