Skip to content

Instantly share code, notes, and snippets.

@dmichael
Created November 13, 2011 15:08
Show Gist options
  • Select an option

  • Save dmichael/1362199 to your computer and use it in GitHub Desktop.

Select an option

Save dmichael/1362199 to your computer and use it in GitHub Desktop.
Neural Network Feedforward
m = size(X, 1);
a1 = [ones(m, 1) X]; % Add the biases to the input matrix
z2 = a1 * Theta1';
a2 = sigmoid(z2);
n = size(a2, 1);
a2 = [ones(n,1) a2]; % Add the biases
z3 = a2 * Theta2';
h = a3 = sigmoid(z3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment