google / jaxopt

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

Passing bounds to the ScipyMinimize wrapper? #388

Closed lcgordon closed 1 year ago

lcgordon commented 1 year ago

Hi! I'm trying to use ScipyMinimize() with the bounds keyword. It looks like passing bounds using the jaxopt wrapper is implemented in the class in the private _run() method (lines 302-303 in jaxopt/_src/scipy_wrappers.py) but the public run() automatically passes bounds=None to _run() (line 334). Is this an issue of just needing to edit run() to allow bounds or is there another reason that this was disabled?

mblondel commented 1 year ago

You need to use ScipyBoundedMinimize instead.

https://jaxopt.github.io/stable/constrained.html#box-constraints