Skip to content

Commit

Permalink
fix a bug in ex4
Browse files Browse the repository at this point in the history
  • Loading branch information
sigpro committed Oct 23, 2012
1 parent c4e99bb commit ba1351b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ex4/nnCostFunction.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
% temp = (delta_2(:,2:end)*Theta1);
% temp = temp(:,2:end);
% delta_1 = temp.*sigmoidGradient(X);
Theta2_grad(1,:) = delta2(1,:)./m;
Theta2_grad(2:end,:) = (lambda*Theta2(2:end,:) + delta2(2:end,:))./m;
Theta1_grad(1,:) = delta1(1,:)./m;
Theta1_grad(2:end,:) = (lambda*Theta1(2:end,:) + delta1(2:end,:))./m;
Theta2_grad = delta2./m;
Theta2_grad(:, 2:end) = (lambda*Theta2(:, 2:end) + delta2(:, 2:end))./m;
Theta1_grad = delta1./m;
Theta1_grad(:, 2:end) = (lambda*Theta1(:, 2:end) + delta1(:, 2:end))./m;



Expand Down

0 comments on commit ba1351b

Please sign in to comment.