Skip to content

Commit

Permalink
Merge pull request lightaime#2 from JoshZastrow/patch-1
Browse files Browse the repository at this point in the history
Update cnn.py -- Regularization function - fixed a typo
  • Loading branch information
lightaime authored May 7, 2017
2 parents facb902 + 47cc97c commit ebeb3ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assignment2/cs231n/classifiers/cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def loss(self, X, y=None):
loss, dout = softmax_loss(scores, y)

# Add regularization
loss += self.reg * 0.5 * (np.sum(self.params['W1'] ** 2) + np.sum(self.params['W2'] ** 2) + np.sum(self.params['W1'] ** 2))
loss += self.reg * 0.5 * (np.sum(self.params['W1'] ** 2) + np.sum(self.params['W2'] ** 2) + np.sum(self.params['W3'] ** 2))

dX3, grads['W3'], grads['b3'] = affine_backward(dout, cache_forward_3)
dX2 = relu_backward(dX3, cache_relu_2)
Expand Down

0 comments on commit ebeb3ef

Please sign in to comment.