Skip to content

Commit

Permalink
Merge pull request #9 from mizti/master
Browse files Browse the repository at this point in the history
Update two_layer_net.py
  • Loading branch information
koki0702 authored Jul 2, 2018
2 parents ea91786 + 64bd16e commit 77eba24
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 77eba24

Please sign in to comment.