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

ScipyMinimize(method="TNC") is broken #536

Closed
terhorst opened this issue Sep 16, 2023 · 2 comments · Fixed by #542
Closed

ScipyMinimize(method="TNC") is broken #536

terhorst opened this issue Sep 16, 2023 · 2 comments · Fixed by #542
Labels
bug Something isn't working

Comments

@terhorst
Copy link

Scipy's TNC implementation does not set the number of Jacobian evaluations in the ScipyOptimizeResult, which causes the jaxopt wrapper to throw:

ScipyMinimize(method="TNC", fun=lambda x: x**2).run(1.0)
# Traceback (most recent call last):     
# ...
# KeyError: 'njev'

I'm running jaxopt 0.8 and Scipy 1.11.2.

@mblondel
Copy link
Collaborator

mblondel commented Oct 2, 2023

I believe this is the same issue as #531.

@zaccharieramzi Looks like some attributes are missing depending on the solver.

@mblondel mblondel added the bug Something isn't working label Oct 2, 2023
@zaccharieramzi
Copy link
Contributor

@mblondel indeed it's probably the same thing.

The scipy doc is a bit elusive on the topic since it says that njev is always accessible normally.

I will try to come up with a quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants