-
Notifications
You must be signed in to change notification settings - Fork 91
Added Adam optimizer implementation #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Good so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Spnetic-5, this is almost good to go. The only thing missing is the convergence test for Adam in test/test_optimizers.f90.
CI seems to have trouble downloading test files from GitHub. Not real failures; tests pass on my end. |
@Spnetic-5, just checking, your latest commit message mentions the convergence test but the commit doesn't actually include the test. |
Sorry, forgot to push test file😅️ |
Thank you, @Spnetic-5, will merge. Please release v0.14.0 when ready. |
Adam Implementation:
Momentum Update:
m = beta1 * m + (1 - beta1) * gradient
Adaptive Learning Rates Update:
v = beta2 * v + (1 - beta2) * gradient**2
Bias-Corrected First and Second Moment Estimates:
m_hat = m / (1 - beta1**t)
v_hat = v / (1 - beta2**t)
Parameter Update:
param = param - learning_rate * m_hat / (sqrt(v_hat) + epsilon)