jaxopt icon indicating copy to clipboard operation
jaxopt copied to clipboard

trust-ncg in ScipyMinimize argument issue

Open hanzy1110 opened this issue 3 years ago • 2 comments

Hi! I've been trying to use the scipy wrapper for the trust-ncg method. When I do this, I'm prompted to pass the hessian vector product as an argument. The source code for the _run method is as follows (from the documentation): res = osp.optimize.minimize(scipy_fun, jnp_to_onp(init_params, self.dtype), jac=True, bounds=bounds, method=self.method, options=self.options) Which doesn't allow the hess argument to be passed to scipy. indeed when I pass the hess argument inside options I get an exception telling me scipy has received hess twice and when I don't pass it the resulting exception tells me that I haven't specified the hessian.

hanzy1110 avatar Jun 11 '22 17:06 hanzy1110

Thanks for the bug report. When trust-ncg is used, we should provide the Hessian vector product automatically for the user.

CC @fllinares

mblondel avatar Jun 13 '22 12:06 mblondel

Just adding that I hit this bug as well. Couldn't figure out a way to pass the hessian.

Edit: And just want to say thank you for the awesome library - its so incredibly fast and easy to use!

ignacio-rh avatar Aug 03 '22 16:08 ignacio-rh