Box projection with zoom line search #1415
Replies: 2 comments
-
I don't believe it's something we support now, but we can look into it. You could try a proxy objective with an exact penalty function or writing your own linesearch implementation. |
Beta Was this translation helpful? Give feedback.
-
You could also try chaining Another option is to optimize in an unconstrained space and pass the unconstrained values through a sigmoid before evaluating the loss, like this:
though that will warp the loss surface and the gradients will approach 0 near the bounds. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an objective function that I am trying to minimize with
optax.lbfgs()
, which I believe chainsoptax.scale_by_lbfgs()
andoptax.scale_by_zoom_linesearch()
under the hood. I useoptax.projections.projection_box()
to restrict the function parameters to a specified range. In particular, the parameters need to be strictly positive otherwise the function evaluation fails. This is where my problem arises: it seems like the zoom linesearch will sometimes try to evaluate the function at negative values that fall outside of the box projection, causing it to throw an error and thus the optimizer fails. Is there a way to restrict the parameter values during the zoom linesearch? Or is there a linesearch better suited for constrained problems?I am not able to create a minimum example of the problem, but I am using the example LBFGS solver from the docs page with one line added to do the box projection:
Beta Was this translation helpful? Give feedback.
All reactions