Created
July 13, 2019 23:57
-
-
Save ksivaman/3a9c281c3104ebbb052e9d754fae8ddb to your computer and use it in GitHub Desktop.
A function to update weights and biases for a feed forward neural network.
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 param_updates(params_w, params_b, gradients, lr, layers=[4, 5, 1]): | |
for index in range(len(layers) - 1): | |
#gradient descent | |
params_w["weight" + str(index + 1)] -= lr * gradients["d_weight" + str(index + 1)] | |
params_b["bias" + str(index + 1)] -= lr * gradients["d_bias" + str(index + 1)] | |
return params_w, params_b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment