Comments (6)
Hi @erdmann!
Indeed, LBFGS
currently doesn't support a stepsize
option at the moment.
ProximalGradient
and GradientDescent
do support this option but the behavior is slightly different from what you want:
- If
stepsize
is a float and <= 0, use linesearch - If
stepsize
is a a float and >=, use this value as constant step size - If
stepsize
is a Callable of the formstepsize(iter_num)
, then use the output of this function
I think for consistency we should implement the same behavior in LBFGS.
Regarding the ability to initialize the linesearch with a value of the user's choosing, currently this is not possible. We would need to think it it's really useful (normally, without numerical instability issues, the line search is supposed to auto-tune the stepsize) and how to integrate it in the API. Currently, we only support backtracking line search but we plan to support more line search strategies and to let the user pass a line search object. Maybe the option you propose could be added in this context.
In the meantime, I would try 64-bit precision to see if the numerical issues disappear.
from jaxopt.
I'm finding myself in a similar position, even with x64 enabled. The LBFGS implementation initial stepsize is 1.0 * increase_factor
which results in a large number of iterations compared to the SciPy wrapper implementation (see here for example). Without x64 enabled it fails to proceed beyond its initialization due to nan
/ model misspecification.
It would be fantastic to have a more flexible initialization at some point in the future. Thank you and the team for developing such a useful library.
from jaxopt.
What do you think of replacing init_stepsize = state.stepsize * self.increase_factor
with init_stepsize = min(state.stepsize * self.increase_factor, 1.0)
as a safegard? (see this line)
from jaxopt.
Thanks @mblondel . It might need to wait until configurable LineSearch objects can be initialized and passed in to create a more flexible starting point.
I found a simpler example where LBFGS chokes compared to other methods. See here
from jaxopt.
@mblondel seems like latest release fixed the issues reported in my above example. Thanks so much!
from jaxopt.
Glad to hear that and sorry it took some time!
Thanks #236 and #239, it's now possible to set the initial step size using the max_stepsize
option.
I am closing this issue but feel free to re-open if necessary.
from jaxopt.
Related Issues (20)
- Add usage examples for the documentations HOT 4
- LevenbergMarquardt do not seems to work with non-flat input. HOT 1
- Parallel execution of multiple optimization processes HOT 3
- OSQP should inherit from IterativeSolver HOT 1
- Number of gradient evaluations not applicable to scipy's gradient-free optimizers
- Constrained Optimization and Spanning Tree Polytope HOT 4
- ScipyMinimize(method="TNC") is broken HOT 2
- PolyakSGD should take an optional parameter f_star
- Implicitly differentiate the KKT conditions HOT 5
- OSQP solvers with fun set and no init_params have misleading error message HOT 8
- BoxOSQP does not work without equality constraints HOT 5
- Type precision issue in BoxOSQP HOT 10
- Garbage collection issues HOT 1
- Wrong failure diagnostic print outs from `ZoomLineSearch` under `vmap` HOT 3
- Attempted boolean conversion of traced array - for hager-zhang HOT 2
- Expression tree API like CVXPY HOT 3
- Unnecessary recompilation of _while_loop_lax HOT 8
- Add type annotations
- Consider switching to pyproject.toml
- OSQP crashing on unexpected params HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jaxopt.