Skip to content

Commit 64bd16e

Browse files
authored
Update two_layer_net.py
da1, dz1の入れ替わりを修正
1 parent 148983d commit 64bd16e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ch04/two_layer_net.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def gradient(self, x, t):
7070
grads['W2'] = np.dot(z1.T, dy)
7171
grads['b2'] = np.sum(dy, axis=0)
7272

73-
da1 = np.dot(dy, W2.T)
74-
dz1 = sigmoid_grad(a1) * da1
75-
grads['W1'] = np.dot(x.T, dz1)
76-
grads['b1'] = np.sum(dz1, axis=0)
73+
dz1 = np.dot(dy, W2.T)
74+
da1 = sigmoid_grad(a1) * dz1
75+
grads['W1'] = np.dot(x.T, da1)
76+
grads['b1'] = np.sum(da1, axis=0)
7777

78-
return grads
78+
return grads

0 commit comments

Comments
 (0)