Skip to content

Instantly share code, notes, and snippets.

@bushaev
Created September 2, 2018 14:17
Show Gist options
  • Select an option

  • Save bushaev/f7b05dc0525bd49124046806ee5e2eeb to your computer and use it in GitHub Desktop.

Select an option

Save bushaev/f7b05dc0525bd49124046806ee5e2eeb to your computer and use it in GitHub Desktop.
drad_squared = 0
for _ in num_iterations:
dw = compute_gradients(x, y)
grad_squared = 0.9 * grads_squared + 0.1 * dx * dx
w = w - (lr / np.sqrt(grad_squared)) * dw
@pythonpypy
Copy link

pythonpypy commented Mar 1, 2019

It should be :
grad_squared = 0
for _ in range (num_iterations):
dw = compute_gradients(x, y)
grad_squared = 0.9 * grad_squared + 0.1 * (dw * dw) # or grad_squared = 0.9 * grad_squared + 0.1 * (dw ) ** 2
w = w - (lr / np.sqrt(grad_squared)) * dw

@frankbryce
Copy link

+1 to the above comment, it seems there are a few typos, here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment