Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save bushaev/df15464561274b52e3ba65f9ae1c941a 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)
m_hat = m / (1 - np.power(beta_1, t))
v_hat = v / (1 - np.power(beta_2, t))
w = w - step_size * m_hat / (np.sqrt(v_hat) + epsilon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment