Comments (5)
I think you might be better served by instead setting adaptive_rho_interval
to some positive integer, say 25 or 50, and keeping adaptive_rho = true
. That would allow the solver to adapt the rho parameter as needed, but do so in a deterministic way based on iteration count rather than based on the timing of the initial matrix factorization.
I agree that this should be better documented.
from osqp-python.
Thanks for reaching out. We don't employ randomness or stochasticity in the algorithm, and I actually wouldn't expect it to converge to two solutions if it is a convex problem (we should always be converging to be near the global solution). I haven't tried running it yet, but do you observe the difference starting near where a rho value update has happened? By default OSQP will do an automatic rho update using time measures, so that could be slightly different if some computations take longer certain times. One thing you could try is to fix the rho update interval to a set number of iterations and see if the behaviors change.
from osqp-python.
@imciner2's explanation about time-based rho updated is very likely the correct one. See osqp/osqp#239, which was the same issue.
from osqp-python.
Alternative suggestion : in your example, use:
qsp.solve(verbose=True, solver=cp.CLARABEL)
which uses an interior point method instead. That solver is always deterministic and will also give higher accuracy solutions.
from osqp-python.
Hi @imciner2 and @goulart-paul,
Thank you both for your quick replies. Your suggestion about the adaptive rho appears to be the cause of our observations. My (maybe naive) fix for this has been to specify the keyword argument adaptive_rho=False
and we are now achieving the same solution every time.
Have you considered documenting this potential behaviour in the rho setp-size section? I think indicating that this non-determinism is possible when the same computations take different times could be valuable to other users. Then again, it seems that this is a rare occurrence.
We will look into the use of Clarabel, thanks for the suggestion.
Thank you very much again,
Tim
from osqp-python.
Related Issues (20)
- Error in building wheel for osqp because "No module named cmake' " HOT 1
- No wheels for Python 3.11 HOT 1
- Cannot install osqp on MacOSX HOT 3
- Numpy 1.24 breaks builtin type aliases HOT 1
- symbol not found in flat namespace '_csc_matrix'
- Python solve is faster than C code-generated one HOT 4
- FLOAT codegen argument doesn't work as expected
- Install fails because of metadata version on Mac OS HOT 14
- Turn solving verbosity off HOT 1
- no ‘cuda pcg’ support
- OSQP.update and scaling error
- unit test failures with scipy 1.12 HOT 2
- Enhancements for skbuild migration HOT 1
- OSQP requirement of scipy < 1.12.0 slows applications down on Apple Silicon HOT 3
- Wrap generated C code with tiny python functionalities HOT 1
- Integrate new codegen with cvxpygen HOT 1
- Add CONTRIBUTING.md
- Support codegen in editable install HOT 1
- Add macOS arm64 wheel HOT 1
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 osqp-python.