Update 06_multicat.ipynb (#349)

Fix binary_cross_entropy
This commit is contained in:
Joe Bender 2020-12-11 16:36:58 -05:00 committed by GitHub
parent 08746b427e
commit 1cf5630742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -976,7 +976,7 @@
"source": [
"def binary_cross_entropy(inputs, targets):\n",
" inputs = inputs.sigmoid()\n",
" return -torch.where(targets==1, inputs, 1-inputs).log().mean()"
" return -torch.where(targets==1, 1-inputs, inputs).log().mean()"
]
},
{