Skip to content

cvxgrp/sccf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sccf

sccf is a CVXPY extension for (approximately) minimizing a sum of clipped convex functions. The algorithms used are described in our paper.

Installation

Clone the repository, then run:

pip install .

Usage

sccf exposes a function minimum and a class Problem. One constructs an objective as a sum of terms that have the form sccf.minimum(expr, constant), then constructs a Problem object as sccf.Problem(objective, constraints). Then one calls the solve method, which has the following signature:

def solve(self, method="alternating", *args, **kwargs):
    """Approximately solve the problem using alternating, convex-concave, or L-BFGS.

    Parameters
    ==========
    method : str
        alternating, cvx_ccv, or lbfgs
    args, kwargs: sent to underlying solve method and cvxpy.
    """

For example:

import sccf
import cvxpy as cp

x = cp.Variable(10)
objective = sccf.minimum(cp.sum_squares(x), 1.0) + sccf.minimum(cp.sum_squares(x - .1), 1.0)
constraints = [cp.sum(x) == 1.0, x >= 0, x <= 1]
prob = sccf.Problem(objective, constraints)
prob.solve()

Examples

For the examples in the paper, and more, see the examples folder.

Run tests

Run:

python -m unittest

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Apache 2.0

Citing

If you use sccf in your research, please consider citing our paper:

@article{barratt2019minimizing,
    title={Minimizing a Sum of Clipped Convex Functions},
    author={Barratt, Shane and Angeris, Guillermo and Boyd, Stephen},
    journal={arXiv},
    year={2019}
}

Notes

A specialized verison of sccf for robust regression was implemented in the LinRegOutliers Julia package.

About

Repository for "Minimizing a sum of clipped convex functions" paper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages