SHARE

TWEET

# Untitled

a guest
Jul 11th, 2018
50
Never

**Not a member of Pastebin yet?**

**, it unlocks many cool features!**

__Sign Up__- # Check Results
- # Call the Feedforward Function to get h
- h <- feedforward(X,Theta1,Theta2)
- dim(h)
- #Recode the labels as vectors containing only values 0 or 1
- #For example, if x(i) is an image of the digit 5,
- #then the corresponding y(i) (that you should use with the cost function)
- #should be a 10-dimensional vector with y5 = 1, and the other elements equal to 0.
- y_matrix <- matrix(0, nrow = length(y), ncol = 10)
- dim(y_matrix)
- for (i in 1:m){
- ans <- y[i]
- y_matrix[i,ans] <- 1
- }
- # Check the Dimension of y
- m = length(y)
- # Compute cost
- J=ComputeFFCost(h,y_matrix,m)
- J

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.