GithubHelp home page GithubHelp logo

Comments (5)

goulart-paul avatar goulart-paul commented on July 28, 2024 2

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.

imciner2 avatar imciner2 commented on July 28, 2024

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.

goulart-paul avatar goulart-paul commented on July 28, 2024

@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.

goulart-paul avatar goulart-paul commented on July 28, 2024

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.

timothy-nunn avatar timothy-nunn commented on July 28, 2024

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)

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.