We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you vectorize cost and backprop, 50 epochs takes 2.4 seconds instead of 150 seconds.
Vectorized cost: replace this loop with
yy = zeros(size(y,1),num_labels); yy(sub2ind(size(yy),1:length(y),y'))=1; J = sum(sum(- yy .* log(a3) - (1 - yy) .* log(1 - a3)))/m;
Vectorized backprop: replace this loop with
d3 = a3 - yy; d2 = (d3 * Theta2) .* [ones(m, 1) sigmoidGradient(z2)]; d2 = d2(:,2:end); Theta1_grad = d2' * a1; Theta2_grad = d3' * a2;
The text was updated successfully, but these errors were encountered:
Do you wanna make a PR?
Sorry, something went wrong.
No branches or pull requests
If you vectorize cost and backprop, 50 epochs takes 2.4 seconds instead of 150 seconds.
Vectorized cost: replace this loop with
Vectorized backprop: replace this loop with
The text was updated successfully, but these errors were encountered: