Created
June 24, 2019 22:29
-
-
Save nanotroy/2b6911afa2fb20faf3e89ebdf58e31a2 to your computer and use it in GitHub Desktop.
This file contains 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 setParameters(X, Y, hidden_size): | |
np.random.seed(3) | |
input_size = X.shape[0] # number of neurons in input layer | |
output_size = Y.shape[0] # number of neurons in output layer. | |
W1 = np.random.randn(hidden_size, input_size)*np.sqrt(2/input_size) | |
b1 = np.zeros((hidden_size, 1)) | |
W2 = np.random.randn(output_size, hidden_size)*np.sqrt(2/hidden_size) | |
b2 = np.zeros((output_size, 1)) | |
return {'W1': W1, 'W2': W2, 'b1': b1, 'b2': b2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment