Automatic differentiation (autodiff) has revolutionized machine learning. It allows to express complex computations by composing elementary ones in creative ways and removes the burden of computing their derivatives by hand. More recently, differentiation of optimization problem solutions has attracted widespread attention with applications such as optimization layers, and in bi-level problems such as hyper-parameter optimization and meta-learning. However, so far, implicit differentiation remained difficult to use for practitioners, as it often required case-by-case tedious mathematical derivations and implementations. In this paper, we propose automatic implicit differentiation, an efficient and modular approach for implicit differentiation of optimization problems. In our approach, the user defines directly in Python a function $F$ capturing the optimality conditions of the problem to be differentiated. Once this is done, we leverage autodiff of $F$ and the implicit function theorem to automatically differentiate the optimization problem. Our approach thus combines the benefits of implicit differentiation and autodiff. It is efficient as it can be added on top of any state-of-the-art solver and modular as the optimality condition specification is decoupled from the implicit differentiation mechanism. We show that seemingly simple principles allow to recover many existing implicit differentiation methods and create new ones easily. We demonstrate the ease of formulating and solving bi-level optimization problems using our framework. We also showcase an application to the sensitivity analysis of molecular dynamics.
翻译:自动差异( autodiff) 使机器学习发生革命性的变化。 它允许通过以创造性方式将基本差异以创造性方式组合成初级差异来表达复杂的计算方法, 并消除手工计算衍生物的负担。 最近, 优化问题解决方案的区别吸引了优化层等应用和超参数优化和元学习等双层问题的广泛关注。 然而, 到目前为止, 隐含差异仍然难以为从业者使用, 因为它常常需要逐个案例的重复数学衍生和实施。 在本文中, 我们提出自动隐含差异, 一种高效和模块化的方法, 用于对优化问题进行隐含的区分。 在我们的方法中, 用户直接在 Python 中定义一个功能 $F$, 以捕捉问题的最佳性条件, 以区别为对象。 一旦这样做, 我们就会自动利用 $F$ 和隐含的函数来自动区分优化问题。 我们的方法因此将隐含差异差异和自动化的数学应用结合起来。 因为它可以在任何州- 状态和模块上添加一个高效的方法, 作为优化条件规格的规格规格规格规格规格规格规格的规格规格说明。 我们表面上展示了一种简单的精确的精确的模型, 演示了一种方法, 以恢复和新式格式化的精确的精确的模型的模型的模型的模型的模型的复制式的模型。