Skip to content

Instantly share code, notes, and snippets.

@nicolamontecchio
Created February 11, 2015 19:56
Show Gist options
  • Save nicolamontecchio/ee2abd3a652824ef9dc0 to your computer and use it in GitHub Desktop.
Save nicolamontecchio/ee2abd3a652824ef9dc0 to your computer and use it in GitHub Desktop.
nesterov
def nesterov_optimizer(g, w0, alpha, mu):
dim = w0.shape[0]
w = w0
v = np.zeros(dim)
while True:
yield w
v = mu * v - alpha * g(w + mu * v)
w = w + v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment