Coursera
Coursera copied to clipboard
nnCostFunction.m in ex4
I think that:
z2t = [1; Theta1 * a1t];
d2t = Theta2' * d3t .* sigmoidGradient(z2t);
should be:
z2t = Theta1 * a1t;
d2t = Theta2' * d3t .* [1; sigmoidGradient(z2t)];
You do not add 1 to compute z2.