Skip to content

Inconsistency between jax.scipy.minimize and jaxopt.LBFGS #322

Discussion options

You must be logged in to vote

I found out! Took quite some time of debugging but here you go: the discrepancy comes from the fact that in jax.scipy.minimize when the line search fails, i.e. ls_results.failed == True, the status is then 5.
In turn, this makes the LBFGS state failed attribute True.
When this attribute is True, then of course the iterations stop.

This is not the case in jaxopt. Indeed, no matter the failure of the line search, the step size is always accepted. This is because the LBFGS state in jaxopt is less rich than in jax.scipy.minimize, and it does not allow some more custom logic in the IterativeSolver's _cond_fun. Maybe one way to get back that consistency would be to enrich the LBFGSState tuple w…

Replies: 10 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zaccharieramzi
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zaccharieramzi
Comment options

Comment options

You must be logged in to vote
1 reply
@zaccharieramzi
Comment options

Comment options

You must be logged in to vote
3 replies
@sabrinastronomy
Comment options

@zaccharieramzi
Comment options

@vroulet
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants