https://github.com/cvxgrp/cvxpyrepair
Code for "Automatic repair of convex optimization problems".
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.9%) to scientific vocabulary
Repository
Code for "Automatic repair of convex optimization problems".
Basic Info
- Host: GitHub
- Owner: cvxgrp
- License: apache-2.0
- Language: Python
- Default Branch: master
- Size: 14.6 KB
Statistics
- Stars: 14
- Watchers: 11
- Forks: 4
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
cvxpyrepair
cvxpyrepair is a Python package that implements the algorithms described in our paper Automatic repair of convex optimization problems.
Installation
To install, run:
bash
pip install .
Running the Examples
Navigate to the examples folder.
To run the spacecraft landing example:
python spacecraft_landing.py
To run the arbitrage example:
python arbitrage.py
To run the boolean LP example:
python boolean_lp.py
API
The package has a single API, the repair function, which takes in a CVXPY
problem, a list of parameters, and a regularization function, and
tries to repair the problem by changing the parameters and keeping the
regularization function small.
The repair function has the signature:
```
def repair(prob, params, r=None, verbose=True, maxiter=10, maxiterpgm=25,
lam=1, lamfactor=2, lr=.1):
"""
Repairs prob by altering params.
Minimizes r(params) subject to the constraint that prob is solvable.
Args:
- prob: cvxpy Problem object
- params: list of cvxpy Parameters involved in prob
- r (optional): callable that takes a list of cvxpy Variables as input
(of the same dimension as params), and returns a cvxpy expression
representing the performance metric (default=None).
- verbose (optional): whether or not to print diagnostic informtion (default=True).
- maxiter (optional): Maximum number of outer iterations (default=10).
- maxiter_pgm (optional): Maximum number of inner iterations (default=25).
- lam (optional): Starting value for 1/lambda, multiplied by lam_factor
each iteration (default=1).
- lam_factor (optional): Factor to multiply lambda by each iteration (default=2).
- lr (optional): initial step size for proximal gradient method (default=.1).
"""
```
License
This repository carries an Apache 2.0 license.
Citing
If you use cvxpyrepair in your research, please consider citing our accompanying paper:
@article{barratt2020automatic,
author={Barratt, S. and Angeris, G. and Boyd, S.},
title={Automatic Repair of Convex Optimization Problems},
year={2020},
journal={Manuscript}
}
Owner
- Name: Stanford University Convex Optimization Group
- Login: cvxgrp
- Kind: organization
- Location: Stanford, CA
- Website: www.stanford.edu/~boyd
- Repositories: 102
- Profile: https://github.com/cvxgrp
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- cvxpy *
- diffcp *
- numpy *
- scipy *