google / jaxopt

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

Newton's method? #399

Open ahwillia opened 1 year ago

ahwillia commented 1 year ago

I'd like to apply Newton's method on a convex problem. When I try jaxopt.ScipyMinimize with method="trust-exact" I get the error:

ValueError: Hessian matrix is required for trust region exact minimization.

Is there a way to pass the Hessian matrix? Even better, is there a plan to re-implement some of the scipy minimize algorithms inside jaxopt?

EDIT: My code does seem to work when I switch to method="newton-cg".

mblondel commented 1 year ago

We should pass the Hessian vector product when the solver is newton-cg. Contribution welcome!

wdwatson2 commented 4 weeks ago

This is still an issue. Nothing is wrong with 'newton-cg', however the following three methods still suffer from the bug mentioned by @ahwillia: ‘trust-ncg’, ‘trust-exact’, ‘trust-krylov’