daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # create FeefForward Neural Network
  2. feedforward <- function(X, Theta1,Theta2) {
  3. #Add a column of 1s to X (the first column), and it becomes 'a1'.
  4.   a1 <- cbind(1, X)
  5. #Multiply by Theta1 and we have 'z2'.
  6.   z2 <- a1 %*% t(Theta1)
  7. #Compute the sigmoid() of 'z2', then add a column of 1's, and it becomes 'a2'
  8.   a2 <- sigmoid(z2)
  9.   a2 <- cbind(1, a2)
  10. #Multiply by Theta2 and you have 'z3'.
  11.   z3 = a2 %*%  t(Theta2)
  12. #Compute the sigmoid() of z3, then add a column of 1's, and it becomes 'a3'
  13.   a3 = sigmoid(z3);
  14.   h=a3
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top