Skip to content

Instantly share code, notes, and snippets.

@marcopeix
Created February 26, 2019 18:13
Show Gist options
  • Save marcopeix/a83cf303c74baf2d4c8d4cb8dc6eaa5c to your computer and use it in GitHub Desktop.
Save marcopeix/a83cf303c74baf2d4c8d4cb8dc6eaa5c to your computer and use it in GitHub Desktop.
def update_parameters(parameters, grads, learning_rate):
L = len(parameters) // 2 # number of layers in the neural network
for l in range(L):
parameters["W" + str(l+1)] = parameters['W' + str(l + 1)] - learning_rate * grads['dW' + str(l + 1)]
parameters["b" + str(l+1)] = parameters['b' + str(l + 1)] - learning_rate * grads['db' + str(l + 1)]
return parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment