google / jaxopt

Hardware accelerated, batchable and differentiable optimizers in JAX.
https://jaxopt.github.io
Apache License 2.0
936 stars 66 forks source link

made sure to use njev only when available in scipy optimize results #542

Closed zaccharieramzi closed 1 year ago

zaccharieramzi commented 1 year ago

This should fix #536 and #531

Basically makes the nfev (function eval), njev (jacobian eval) and nhev (hessian eval) counts 0 if they are not present in the scipy results.

This was already the behaviour for the hessian.

mblondel commented 1 year ago

Thanks a lot for the fix @zaccharieramzi. Can you add a non-regression test, for example using "TNC" as in #536.

zaccharieramzi commented 1 year ago

Sure! Will do

zaccharieramzi commented 1 year ago

@mblondel : added nonregression tests, made sure that they fail without the fix and they are green now