Last active
April 12, 2020 21:28
-
-
Save SkalskiP/427b3188c8501d31b4d4024b923b6cd4 to your computer and use it in GitHub Desktop.
Updating parameter values
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 update(params_values, grads_values, nn_architecture, learning_rate): | |
for layer_idx, layer in enumerate(nn_architecture): | |
params_values["W" + str(layer_idx)] -= learning_rate * grads_values["dW" + str(layer_idx)] | |
params_values["b" + str(layer_idx)] -= learning_rate * grads_values["db" + str(layer_idx)] | |
return params_values; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This Gist, in the context of https://towardsdatascience.com/lets-code-a-neural-network-in-plain-numpy-ae7e74410795, should be changed to enumerate(nn_architecture, 1) to skip the first index (index 0).