Git Product home page Git Product logo

Comments (6)

mblondel avatar mblondel commented on May 5, 2024 1

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 form stepsize(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.

quattro avatar quattro commented on May 5, 2024

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.

mblondel avatar mblondel commented on May 5, 2024

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.

quattro avatar quattro commented on May 5, 2024

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.

quattro avatar quattro commented on May 5, 2024

@mblondel seems like latest release fixed the issues reported in my above example. Thanks so much!

from jaxopt.

mblondel avatar mblondel commented on May 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.