Skip to content
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

ADAM bug when calculating the gradient in batches #178 #183

Merged
merged 12 commits into from
Aug 20, 2024

Conversation

proeseler
Copy link
Contributor

Summary

There is only one small error that prevents ADAM from calculating the gradient_num_diff for batches with max_evals_grouped. ADAM only gives "fun, self._eps" as argument when calling gradient_num_diff. This leads to max_evals_grouped=None, which leads to max_evals_grouped=1. Therefore, regardless of the call to set max_evals_grouped, max_evals_grouped=1 will always apply for ADAM.

Details and comments

This issue was discussed in #178

@coveralls
Copy link

coveralls commented Aug 14, 2024

Pull Request Test Coverage Report for Build 10443892719

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 90.444%

Totals Coverage Status
Change from base Build 10319023971: 0.0%
Covered Lines: 6370
Relevant Lines: 7043

💛 - Coveralls

@proeseler
Copy link
Contributor Author

Just tell me if there is anything else to do.

test/optimizers/test_adam.py Outdated Show resolved Hide resolved
test/optimizers/test_adam.py Outdated Show resolved Hide resolved
@woodsp-ibm woodsp-ibm added bug Something isn't working stable backport potential The bug might be minimal and/or import enough to be port to stable labels Aug 19, 2024
Copy link
Member

@woodsp-ibm woodsp-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments and of course for noticing and taking the time to fix this. It LGTM.

@woodsp-ibm woodsp-ibm merged commit 6724b47 into qiskit-community:main Aug 20, 2024
19 checks passed
mergify bot pushed a commit that referenced this pull request Aug 20, 2024
Co-authored-by: Peter Röseler <peter.roeseler@gmail.com>
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
(cherry picked from commit 6724b47)
mergify bot added a commit that referenced this pull request Aug 20, 2024
#200)

Co-authored-by: Peter Roeseler <148069723+proeseler@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants