Comments (6)
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.
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.
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.
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.
@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.
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)
- drop markdown for notebook examples? HOT 2
- Using `vmap` for root finding with a vector of parameters HOT 8
- LBFGSB produces NaN for certain conditions HOT 1
- Document solver attributes
- 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
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.