Skip to content

Instantly share code, notes, and snippets.

@Mizzlr
Created June 29, 2016 10:25
Show Gist options
  • Select an option

  • Save Mizzlr/eb8eb437214c7fae529924d235a6064e to your computer and use it in GitHub Desktop.

Select an option

Save Mizzlr/eb8eb437214c7fae529924d235a6064e to your computer and use it in GitHub Desktop.
function p = predict(Theta1, Theta2, X)
m = size(X, 1);
h1 = sigmoid([ones(m, 1) X] * Theta1');
h2 = sigmoid([ones(m, 1) h1] * Theta2');
[dummy, p] = max(h2, [], 2);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment