Last active
October 10, 2018 02:09
-
-
Save srikarplus/fad105ec60e40ab6cc70e643556e3464 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def randInitializeWeights(L_in, L_out): | |
epsilon = 0.12 | |
return np.random.rand(L_out, L_in+1) * 2 * epsilon - epsilon | |
initial_theta1 = randInitializeWeights(input_layer_size, hidden_layer_size) | |
initial_theta2 = randInitializeWeights(hidden_layer_size, num_labels) | |
# unrolling parameters into a single column vector | |
nn_initial_params = np.hstack((initial_theta1.ravel(order='F'), initial_theta2.ravel(order='F'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment