Reverse AD at Higher Types: Pure, Principled and Denotationally Correct

07/10/2020
by   Matthijs Vákár, et al.
0

We show how to define source-code transformations for forward- and reverse-mode Automatic Differentiation on a standard higher-order functional language. The transformations generate purely functional code, and they are principled in the sense that their definition arises from a categorical universal property. We give a semantic proof of correctness of the transformations. In their most elegant formulation, the transformations generate code with linear types. However, we demonstrate how the transformations can be implemented in a standard functional language without sacrificing correctness. To do so, we make use of abstract data types to represent the required linear types, e.g. through the use of a basic module system.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/29/2021

CHAD: Combinatory Homomorphic Automatic Differentiation

We introduce Combinatory Homomorphic Automatic Differentiation (CHAD), a...
research
07/07/2022

Efficient Dual-Numbers Reverse AD via Well-Known Program Transformations

Where dual-numbers forward-mode automatic differentiation (AD) pairs eac...
research
10/01/2021

CHAD for Expressive Total Languages

We show how to apply forward and reverse mode Combinatory Homomorphic Au...
research
01/07/2020

Correctness of Automatic Differentiation via Diffeologies and Categorical Gluing

We present semantic correctness proofs of Automatic Differentiation (AD)...
research
10/14/2022

Automatic Differentiation for ML-family languages: correctness via logical relations

We give a simple, direct and reusable logical relations technique for la...
research
08/25/2020

Differentiating a Tensor Language

How does one compile derivatives of tensor programs, such that the resul...
research
11/08/2022

Do Mutable Variables Have Reference Types?

Implicit heterogeneous metaprogramming (a.k.a. offshoring) is an attract...

Please sign up or login with your details

Forgot password? Click here to reset