Giter Club home page Giter Club logo

apc524-admm-4-block's Introduction

=========== admm4block

admm4block provides methods for solving conic programming problems and SDP problems. Typical usage often looks like this:

#!/usr/bin/env python

import admm4block

#generate Copt, Aeq (a list of matrices), beq
mySDP = admm4block.DNNSDP(Copt, Aeq, beq)
#decide sigma, tau, tol and nsteps
mySDP.Solve(sigma, tau, tol, nsteps)

when importing admm4block, the class ConicProgrammingProblem, SDP and DNNSDP are already imported so the user can use::

admm4block.DNNSDP

instead of::

admm4block.sdp.DNNSDP

conic

conic includes the class ConicProgrammingProblem, with the following methods:

  • Solve: Solves the Conic Programming Problem using the ADMM-3-block method explained in [1]. There is no "Step" public function.

  • InitialConditions: Creates feasible initial conditions (x0 = Pseudoinverse of Aeq * beq, s0 = the projection on K* of x0, z0 = the projection on Kp* of x0). If any of the initial conditions is preset it is left that way.

  • init : Requires a nxm matrix Aeq, an array beq of dimension m, an array Copt of dimension n, and two functions K and Kp that indicate the projections onto the cones K and Kp (the duals are calculated using Moreau's decomposition theorem). In the future will admit inequalities too, for now slack variables must be added by the user.

sdp

sdp includes the classes SDP and DNNSDP, with the following methods:

  • toConic: Converts the SDP or DNNSDP into a Conic problem and returns an object of the class ConicProgrammingProblem.

  • Solve: Solves the SDP or DNNSDP problem and returns [X,s,z,y,res,message] where X is the primal variable, and s,z,y are dual variables.

  • init : Requires a list of nxn matrices Aeq, a list beq of the same length, and an nxn matrix Copt (symmetric). The projections onto the cones are automatically generated (thus be careful if you have a condition such as AX <= I)

Examples

To see examples please refer to /bin/ where you will find two scripts commented and ready to use.

Build/Install

The installation is pretty straightforward using python setup.py. For best results I recommend using pip with the following commands::

python setup.py sdist
cd dist
pip install admm4block

Another way is simply running::

python setup.py install

Apparently the first way is better for ensuring easy uninstall in the future with pip uninstall admm4block.

Tests

The tests can be run also using setup.py::

python setup.py test

Or importing them within the Python console.

================= Known issues (v0.3dev)

  • Checking the tolerance in every iteration is too costly.
  • There is no adaptative control for the parameter sigma.
  • There is no multiprocessor implementation of any kind.
  • Input and output is bad, for now the user has to create the list of matrices instead of giving normal conditions such as X[i][i] = 1.
  • The scripts are supposed to be created but they don't get saved, or I don't know how to run them. Will put them as callable modules (main) in the future.
  • No SOCP or LP implemented.

apc524-admm-4-block's People

Contributors

bernatguillen avatar mtarczon avatar laura-yuan avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

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.