Automatic Differentiation using Constraint Handling Rules in Prolog

06/01/2017
by   Samer Abdallah, et al.
0

Automatic differentiation is a technique which allows a programmer to define a numerical computation via compositions of a broad range of numeric and computational primitives and have the underlying system support the computation of partial derivatives of the result with respect to any of its inputs, without making any finite difference approximations, and without manipulating large symbolic expressions representing the computation. This note describes a novel approach to reverse mode automatic differentiation using constraint logic programmming, specifically, the constraint handling rules (CHR) library of SWI Prolog, resulting in a very small (50 lines of code) implementation. When applied to a differentiation-based implementation of the inside-outside algorithm for parameter learning in probabilistic grammars, the CHR based implementations outperformed two well-known frameworks for optimising differentiable functions, Theano and TensorFlow, by a large margin.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/05/2019

On the Equivalence of Forward Mode Automatic Differentiation and Symbolic Differentiation

We show that forward mode automatic differentiation and symbolic differe...
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
12/14/2021

Verifying a Minimalist Reverse-Mode AD Library

By exploiting a number of relatively subtle programming language feature...
research
03/01/2020

Inverse design of photonic crystals through automatic differentiation

Gradient-based inverse design in photonics has already achieved remarkab...
research
05/05/2023

Software-based Automatic Differentiation is Flawed

Various software efforts embrace the idea that object oriented programmi...
research
06/11/2020

A complete equational axiomatisation of partial differentiation

We formalise the well-known rules of partial differentiation in a versio...
research
12/22/2017

Differential geometry and stochastic dynamics with deep learning numerics

In this paper, we demonstrate how deterministic and stochastic dynamics ...

Please sign up or login with your details

Forgot password? Click here to reset