User Guide¶
This guide covers the core concepts and features of CVXPYlayers.
Contents¶
Overview¶
CVXPYlayers converts CVXPY problems into differentiable layers. The key concepts are:
DPP Compliance: Problems must follow Disciplined Parametrized Programming rules
Parameters vs Variables: Parameters are inputs; variables are outputs
Implicit Differentiation: Gradients computed via the KKT conditions
Cone Program Representation: Problems are canonicalized to standard form
Data Flow¶
Parameters (torch/jax/mlx tensors)
|
v
+-------------------+
| Validate & Batch | Check shapes, broadcast
+-------------------+
|
v
+-------------------+
| Canonicalize | CVXPY -> cone program
+-------------------+
|
v
+-------------------+
| Solve | diffcp/CuClarabel/etc.
+-------------------+
|
v
+-------------------+
| Extract Variables | Map solution back
+-------------------+
|
v
Variables (with gradients attached)