Created
February 26, 2019 17:00
-
-
Save marcopeix/27c1c616af8105f4c4d68fd777942e72 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 initialize_parameters_deep(layer_dims): | |
parameters = {} | |
L = len(layer_dims) # number of layers in the network | |
for l in range(1, L): | |
parameters['W' + str(l)] = np.random.randn(layer_dims[l], layer_dims[l-1]) * 0.01 | |
parameters['b' + str(l)] = np.zeros(shape=(layer_dims[l], 1)) | |
assert(parameters['W' + str(l)].shape == (layer_dims[l], layer_dims[l-1])) | |
assert(parameters['b' + str(l)].shape == (layer_dims[l], 1)) | |
return parameters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment