oxfordcontrol / cosmo-python Goto Github PK
View Code? Open in Web Editor NEWPython interface for COSMO.jl convex optimisation solver.
License: Apache License 2.0
Python interface for COSMO.jl convex optimisation solver.
License: Apache License 2.0
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?
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.