Efficient Automatic Differentiation of Implicit Functions

Derivative-based algorithms are ubiquitous in statistics, machine learning, and applied mathematics. Automatic differentiation offers an algorithmic way to efficiently evaluate these derivatives from computer programs that execute relevant functions. Implementing automatic differentiation for programs that incorporate implicit functions, such as the solution to an algebraic or differential equation, however, requires particular care. Contemporary applications typically appeal to either the application of the implicit function theorem or, in certain circumstances, specialized adjoint methods. In this paper we show that both of these approaches can be generalized to any implicit function, although the generalized adjoint method is typically more effective for automatic differentiation. To showcase the relative advantages and limitations of the two methods we demonstrate their application on a suite of common implicit functions. Charles Margossian is a PhD candidate in the Department of Statistics, Columbia University. Michael Betancourt is the principal research scientist at Symplectomorphic, LLC.

[1]  David Duvenaud,et al.  Optimizing Millions of Hyperparameters by Implicit Differentiation , 2019, AISTATS.

[2]  David Duvenaud,et al.  Scalable Gradients for Stochastic Differential Equations , 2020, AISTATS.

[3]  K. Schittkowski,et al.  NONLINEAR PROGRAMMING , 2022 .

[4]  R. Errico What is an adjoint model , 1997 .

[5]  Mythily Ramaswamy Nonlinear functional analysis — A first course , 2004 .

[6]  Michael Betancourt,et al.  A Geometric Theory of Higher-Order Automatic Differentiation , 2018, 1812.11592.

[7]  CaoYang,et al.  Adjoint Sensitivity Analysis for Differential-Algebraic Equations , 2002 .

[8]  Shengtai Li,et al.  Adjoint Sensitivity Analysis for Differential-Algebraic Equations: The Adjoint DAE System and Its Numerical Solution , 2002, SIAM J. Sci. Comput..

[9]  Jiqiang Guo,et al.  Stan: A Probabilistic Programming Language. , 2017, Journal of statistical software.

[10]  James V. Burke,et al.  Algorithmic Differentiation of Implicit Functions and Optimal Values , 2008 .

[11]  Dustin Tran,et al.  TensorFlow Distributions , 2017, ArXiv.

[12]  Barak A. Pearlmutter,et al.  Automatic differentiation in machine learning: a survey , 2015, J. Mach. Learn. Res..

[13]  Charles C. Margossian,et al.  The Discrete Adjoint Method: Efficient Derivatives for Functions of Discrete Sequences , 2020 .

[14]  Charles C. Margossian,et al.  A review of automatic differentiation and its efficient implementation , 2018, WIREs Data Mining Knowl. Discov..