The Stan Math Library: Reverse-Mode Automatic Differentiation in C++

09/23/2015
by   Bob Carpenter, et al.
0

As computational challenges in optimization and statistical inference grow ever harder, algorithms that utilize derivatives are becoming increasingly more important. The implementation of the derivatives that make these algorithms so powerful, however, is a substantial user burden and the practicality of these algorithms depends critically on tools like automatic differentiation that remove the implementation burden entirely. The Stan Math Library is a C++, reverse-mode automatic differentiation library designed to be usable, extensive and extensible, efficient, scalable, stable, portable, and redistributable in order to facilitate the construction and utilization of such algorithms. Usability is achieved through a simple direct interface and a cleanly abstracted functional interface. The extensive built-in library includes functions for matrix operations, linear algebra, differential equation solving, and most common probability functions. Extensibility derives from a straightforward object-oriented framework for expressions, allowing users to easily create custom functions. Efficiency is achieved through a combination of custom memory management, subexpression caching, traits-based metaprogramming, and expression templates. Partial derivatives for compound functions are evaluated lazily for improved scalability. Stability is achieved by taking care with arithmetic precision in algebraic expressions and providing stable, compound functions where possible. For portability, the library is standards-compliant C++ (03) and has been tested for all major compilers for Windows, Mac OS X, and Linux.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/06/2018

Automatic differentiation of ODE integration

We discuss the calculation of the derivatives of ODE systems with the au...
research
12/14/2021

Verifying a Minimalist Reverse-Mode AD Library

By exploiting a number of relatively subtle programming language feature...
research
11/12/2018

A Review of automatic differentiation and its efficient implementation

Derivatives play a critical role in computational statistics, examples b...
research
11/24/2015

DiffSharp: Automatic Differentiation Library

In this paper we introduce DiffSharp, an automatic differentiation (AD) ...
research
12/19/2022

Denotationally Correct, Purely Functional, Efficient Reverse-mode Automatic Differentiation

Reverse-mode differentiation is used for optimization, but it introduces...
research
06/08/2020

AutoMat – Automatic Differentiation for Generalized Standard Materials on GPUs

We propose a universal method for the evaluation of generalized standard...
research
08/25/2020

Differentiating a Tensor Language

How does one compile derivatives of tensor programs, such that the resul...

Please sign up or login with your details

Forgot password? Click here to reset