Skip to content

Instantly share code, notes, and snippets.

@bushaev
Last active October 22, 2018 12:48
Show Gist options
  • Select an option

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

Select an option

Save bushaev/0aa56ebe7764a827813b78dcc5144cd0 to your computer and use it in GitHub Desktop.
for t in range(num_iterations):
g = compute_gradient(x, y)
m = beta_1 * m + (1 - beta_1) * g
v = beta_2 * v + (1 - beta_2) * np.power(g, 2)
v_hat = np.maximum(v, v_hat)
w = w - step_size * m / (np.sqrt(v_hat) + epsilon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment