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 unittestContributing
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
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}
}

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
