Differentiating through Log-Log Convex Programs

Akshay Agrawal, Stephen Boyd
4/27/2020
11 citations
math.OC

Official code: cvxpy/cvxpylayers (2,153 stars, Python, Apache-2.0, last commit 2026-11-12). 1 more implementation below.

Abstract

We show how to efficiently compute the derivative (when it exists) of the solution map of log-log convex programs (LLCPs). These are nonconvex, nonsmooth optimization problems with positive variables that become convex when the variables, objective functions, and constraint functions are replaced with their logs.

Show full abstract

We focus specifically on LLCPs generated by disciplined geometric programming, a grammar consisting of a set of atomic functions with known log-log curvature and a composition rule for combining them. We represent a parametrized LLCP as the composition of a smooth transformation of parameters, a convex optimization problem, and an exponential transformation of the convex optimization problem's solution. The derivative of this composition can be computed efficiently, using recently developed methods for differentiating through convex optimization problems. We implement our method in CVXPY, a Python-embedded modeling language and rewriting system for convex optimization. In just a few lines of code, a user can specify a parametrized LLCP, solve it, and evaluate the derivative or its adjoint at a vector. This makes it possible to conduct sensitivity analyses of solutions, given perturbations to the parameters, and to compute the gradient of a function of the solution with respect to the parameters. We use the adjoint of the derivative to implement differentiable log-log convex optimization layers in PyTorch and TensorFlow. Finally, we present applications to designing queuing systems and fitting structured prediction models.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
cvxpy/cvxpylayersOfficial2,153PythonApache-2.02026-11-12
cvxgrp/cvxpyOfficial24C++Apache-2.02026-09-06
cvxpy/cvxpylayersOfficial100%
Apache-2.0

Differentiable convex optimization layers

2,153196PythonOct 27, 20192 weeks agoApache-2.0
cvxgrp/cvxpyOfficial100%
Apache-2.0

A Python-embedded modeling language for convex optimization problems.

243C++, PythonApr 5, 20232 months agoApache-2.0

Similar Papers

Cite this paper

@article{agrawal2020differentiating,
  title  = {Differentiating through Log-Log Convex Programs},
  author = {Akshay Agrawal and Stephen Boyd},
  year   = {2020},
  eprint = {2004.12553},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.12553}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2004.12553.svg)](https://codeofpaper.com/paper/2004.12553)

Discussion