Skip to content

Commit

Permalink
Update two_layer_net.py
Browse files Browse the repository at this point in the history
da1, dz1の入れ替わりを修正
  • Loading branch information
mizti authored Nov 19, 2016
1 parent 148983d commit 64bd16e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ch04/two_layer_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def gradient(self, x, t):
grads['W2'] = np.dot(z1.T, dy)
grads['b2'] = np.sum(dy, axis=0)

da1 = np.dot(dy, W2.T)
dz1 = sigmoid_grad(a1) * da1
grads['W1'] = np.dot(x.T, dz1)
grads['b1'] = np.sum(dz1, axis=0)
dz1 = np.dot(dy, W2.T)
da1 = sigmoid_grad(a1) * dz1
grads['W1'] = np.dot(x.T, da1)
grads['b1'] = np.sum(da1, axis=0)

return grads
return grads

0 comments on commit 64bd16e

Please sign in to comment.