google / jaxopt

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

Fix lbfgsb grad when bounds are specified #464

Closed phinate closed 1 year ago

phinate commented 1 year ago

Resolves #463 by correctly instantiating the function signature, and by adding the self._grad_fun alias.

Also adds a test to catch this is working (uses the example from #463).

(I've just signed the google CLA also!)

mblondel commented 1 year ago

Merged, thanks! In case you are motivated, I believe ScipyBoundedMinimize has the same issue (implicit diff works with positional arguments but not with keyword arguments).