回答編集履歴
2
もう一度修正
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
out = th.tensor.nnet.softmax(x.dot(W) + b)
|
6
6
|
|
7
|
-
xent = -y * th.tensor.log(out + 1e-8)
|
7
|
+
xent = -(1-y) * th.tensor.log(1-out + 1e-8)
|
8
8
|
|
9
9
|
loss = xent.mean()
|
10
10
|
|
1
クロスエントロピーの式を修正
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
out = th.tensor.nnet.softmax(x.dot(W) + b)
|
6
6
|
|
7
|
-
xent = -y * th.tensor.log(out + 1e-8)
|
7
|
+
xent = -y * th.tensor.log(out + 1e-8)
|
8
8
|
|
9
9
|
loss = xent.mean()
|
10
10
|
|