Skip to content

Instantly share code, notes, and snippets.

@muhammadgaffar
Created October 24, 2018 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muhammadgaffar/616fe32068ee9359de9c5c255cd84deb to your computer and use it in GitHub Desktop.
Save muhammadgaffar/616fe32068ee9359de9c5c255cd84deb to your computer and use it in GitHub Desktop.
def initialize_parameters_he(layer_dims):
parameters = {}
L = len(layer_dims)
for l in range(1,L):
parameters['W'+str(l)] = np.random.randn(layer_dims[l],layer_dims[l-1])*np.sqrt(2./(layer_dims[l-1]))
parameters['b'+str(l)] = np.zeros((layer_dims[l],1))
return parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment