Git Product home page Git Product logo

Comments (6)

mblondel avatar mblondel commented on May 5, 2024 1

Great that the problem disappeared. Not sure what fixed it, maybe ac1bdcd. See https://github.com/google/jaxopt/commits/main/jaxopt/_src/quadratic_prog.py for the history of this file.

from jaxopt.

FerranAlet avatar FerranAlet commented on May 5, 2024

In case it helps, for my research code I've manually implemented the same call that QP would've done except using solve_normal_cg and it does solve it without diverging for c=0. It also gives a solution that is similar to that of gmres when setting c small but non-zero. For gmres, letting c go to zero makes it eventually diverge.

from jaxopt.

Algue-Rythme avatar Algue-Rythme commented on May 5, 2024

Hi Ferran

That's weird, I tried to reproduce your bug and did not succeed: https://colab.research.google.com/drive/1-IS1MIkkXfVuON5IhAT2gxt2pw-5IVz8?usp=sharing

Can you give more details on the versions of Python/Jax/Jaxopt you are using ? Are you working on CPU or GPU ? In the default float32 of Jax or float64 ? Is it wrapped in a jitted block or in "eager" mode ?

If you have a notebook in which you can consistently reproduce the bug that would be great.

Is it diverging for primal/dual computation in run(), or during implicit differentiation ?

from jaxopt.

FerranAlet avatar FerranAlet commented on May 5, 2024

My bad, it was because I had the jaxopt-0.0.1 version; must have been fixed since then!
Just for completeness, it was during the primal/dual computation. Changing the inner solver to solve_normal_cg worked. With jaxopt-0.1.1 gmres (QP's vanilla solver) gives the same result as solve_normal_cg.

Thanks!

from jaxopt.

FerranAlet avatar FerranAlet commented on May 5, 2024

@mblondel @Algue-Rythme during my research I just ran into more NaNs on the default QP solver, so it may not have been fully solved in 0.1.1. It happens roughly for ~5% of the examples and I haven't found any pattern on when. On the other 95% it matches (modulo small precision errors) the result of using solve_normal_cg as the inner solver.

The failure case is quite entangled with my research code so I can't send it atm. If I find a failure pattern I'll design a minimal example and send it to you.

from jaxopt.

mblondel avatar mblondel commented on May 5, 2024

My guess is that the issue is in gmres itself, as our code doesn't seem to contain operations that could result in NaNs.

In #98, @Algue-Rythme is working on a new class EqualityConstrainedQP specific for this case and it will expose the solver, which will allow you to switch to solve_normal_cg.

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.