Skip to content

Instantly share code, notes, and snippets.

@vamc-stash
Last active May 15, 2020 10:13
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 vamc-stash/f5eaa33973474c46746c88403f55e4b9 to your computer and use it in GitHub Desktop.
Save vamc-stash/f5eaa33973474c46746c88403f55e4b9 to your computer and use it in GitHub Desktop.
update parameters
def update_parameters(parameters, grads):
L = len(parameters) // 2
for l in range(L):
parameters['W'+str(l+1)] = parameters['W'+str(l+1)] - epsilon * grads['dW'+str(l+1)] # W = W - lr*(dE/dW)
parameters['b'+str(l+1)] = parameters['b'+str(l+1)] - epsilon * grads['db'+str(l+1)] # b = b - lr*(dE/db)
return parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment