Code Monkey home page Code Monkey logo

cosmo-python's People

Contributors

migarstka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cosmo-python's Issues

Adding cosmo-python to pip and conda

I saw that CVXPY developers wanted to add COSMO.jl as a supported solver. I wanted to tackle this issue.
However, before being able to create a new interface, it would be preferable to have cosmo-python available through pip andconda.
Do you have any plans on adding this in the near future? I would be willing to help if anything is needed.

p.s. Also if you could help for this it would be awesome :),
I was sometimes running into this error when calling PyJulia for the local cosmo-python wrapper. There are many ways to overcome this for local testing, but I am wondering if there are any practical solutions for testing and running CIs?

chordal decomposition available through python interface?

Hi, I am interested in leveraging chordal sparsity patterns for an SDP and am testing the python interface of COSMO.

cone = {'f': n, 's': [n*(n+1)//2]}

# data preparation for problem - I am using CVXPY for modelling, extracting the problem
# data in SCS format (data, _, _ = prob.get_problem_data(cp.SCS)) and then rearranging
# q and the rows of A to be stacked columns of the upper triangle (as opposed to the
# stacked columns of the lower triangle as in SCS)
q = ...
b = ...
A = sparse.vstack((Atop, Abot), format='csc')

model = cosmo.Model()
model.setup(q=q, A=A, b=b, cone=cone, verbose=True, decompose=True)

# solve the problem
model.optimize()

I am correctly solving the Relaxed Two-Way Partitioning Problem (verified soln using JuMP/COSMO). However, I cannot figure out how to enable decomposing the PSDCone based on the clique tree. It seems like the cone is automatically determined to be DensePsdConeTriangle. Is there anything obvious I am missing? thanks!

------------------------------------------------------------------
          COSMO v0.8.1 - A Quadratic Objective Conic Solver
                         Michael Garstka
                University of Oxford, 2017 - 2021
------------------------------------------------------------------

Problem:  x ∈ R^{210},
          constraints: A ∈ R^{230x210} (230 nnz),
          matrix size to factor: 440x440,
          Floating-point precision: Float64
Sets:     DensePsdConeTriangle) of dim: 210 (20x20)
          ZeroSet) of dim: 20
Settings: ϵ_abs = 1.0e-05, ϵ_rel = 1.0e-05,
          ϵ_prim_inf = 1.0e-04, ϵ_dual_inf = 1.0e-04,
          ρ = 0.1, σ = 1e-06, α = 1.6,
          max_iter = 5000,
          scaling iter = 10 (on),
          check termination every 25 iter,
          check infeasibility every 40 iter,
          KKT system solver: COSMO.QdldlKKTSolver
Acc:      Anderson Type2{QRDecomp},
          Memory size = 15, RestartedMemory,	
          Safeguarded: true, tol: 2.0
Setup Time: 0.15ms

Iter:	Objective:	Primal Res:	Dual Res:	Rho:
1	-1.4675e+02	1.1198e+01	1.1926e+00	1.0000e-01
25	-1.6912e+01	1.5344e-02	3.3411e-03	1.0000e-01
50	-1.6973e+01	1.8160e-03	8.9361e-04	1.0000e-01
75	-1.6989e+01	2.7199e-03	9.7718e-04	1.0000e-01
100	-1.6993e+01	8.8353e-04	3.0951e-04	8.4752e-01
125	-1.7000e+01	7.3641e-10	4.7615e-10	8.4752e-01

------------------------------------------------------------------
>>> Results
Status: Solved
Iterations: 136 (incl. 11 safeguarding iter)
Optimal objective: -17
Runtime: 0.012s (11.56ms)

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.