cvxpylayers | Differentiable convex optimization layers | Math library
kandi X-RAY | cvxpylayers Summary
kandi X-RAY | cvxpylayers Summary
cvxpylayers is a Python library for constructing differentiable convex optimization layers in PyTorch, JAX, and TensorFlow using CVXPY. A convex optimization layer solves a parametrized convex optimization problem in the forward pass to produce a solution. It computes the derivative of the solution with respect to the parameters in the backward pass. This library accompanies our NeurIPS 2019 paper on differentiable convex optimization layers. For an informal introduction to convex optimization layers, see our blog post. Our package uses CVXPY for specifying parametrized convex optimization problems.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Construct a CVX layer
- Given a list of parameters return information about the batch size
- Simple qp test
- Compute a CVX layer
- Wrapper function for ConvxPyLayer
- Converts torch tensor to numpy array
- Convert numpy array to torch object
- Full qp
- Run ball problem
- Compute the likelihood of the given parameters
- Compute the QP test
- Compute the QP
- Runs a running example
- Softmax problem
- Resolve the problem
- Sigmoid
cvxpylayers Key Features
cvxpylayers Examples and Code Snippets
Community Discussions
Trending Discussions on cvxpylayers
QUESTION
I'm trying to solve a SOCP problem using cvxpy
and integrating it to cvxpylayers
. I'm looking at this SOCP problem (problem 11) (here is the scihub link in case you can't access), and here is a snippet of the problem (note min (p-t)
comes from an adaptation of problem 4 using expression 8 in the link above):
Go to ---> EDIT 2
OLD
I've looked at this example, but is still stuck and can't get the problem to be solved. Here is a sample code at my attempt:
...ANSWER
Answered 2020-Dec-11 at 12:20You should change
x.T @ Q @ x <= N * p**2
to
(x.T @ Q @ x)/p <= N * p
assuming p>=0.
Btw if you want to know more about how to formulate this as a SOCP, then consult the Mosek modelling cookbok.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cvxpylayers
Python 3
NumPy
CVXPY >= 1.1.a4
PyTorch >= 1.0, JAX >= 0.2.12, or TensorFlow >= 2.0
diffcp >= 1.0.13
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page