Created
February 11, 2015 19:56
-
-
Save nicolamontecchio/ee2abd3a652824ef9dc0 to your computer and use it in GitHub Desktop.
nesterov
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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