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>
This commit is contained in:
Benjamin van der BurghandBen van der Burgh authored and GitHub committed 2022-04-25 15:50:24 +10:00
1 parent e170b69503
commit b87a476975
1 file changed
+2 -2
+2 -2
View File
@@ -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:"
]
},
{
@@ -3859,7 +3859,7 @@
}
],
"source": [
"corrects = (preds>0.5).float() == train_y\n",
"corrects = (preds>0.0).float() == train_y\n",
"corrects"
]
},