about
Automatic Differentiation Using Constraint Handling Rules in Prolog (2017) (arxiv.org)
3 points by carapace on Feb 19, 2020 | hide | past | pdf | discuss on HN

In plain words: It computes exact derivatives of a program by running its steps backward using Prolog's rule system, in just 50 lines of code. On a grammar-learning task it beat two popular machine-learning libraries by a large margin.

Abstract · Automatic Differentiation using Constraint Handling Rules in Prolog

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.

Samer Abdallah
arXiv:1706.00231 · cs.MS, cs.PL, cs.SC · submitted Jun 1, 2017
abstract · pdf · html

add comment on HN
Also discussed: Mar 2018 (2 points, 0 comments)