  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. 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.
