From 1cf56307421b6e29c9d6ab02ea5ca69fd4bb6001 Mon Sep 17 00:00:00 2001 From: Joe Bender Date: Fri, 11 Dec 2020 16:36:58 -0500 Subject: [PATCH] Update 06_multicat.ipynb (#349) Fix binary_cross_entropy --- 06_multicat.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/06_multicat.ipynb b/06_multicat.ipynb index 96eadc4..6c3beb5 100644 --- a/06_multicat.ipynb +++ b/06_multicat.ipynb @@ -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()" ] }, {