3 ms·
Differentiation (of functions) is a product-preserving functor, which makes the Chain Rule the rule by which it respects function composition, which makes autom
by eli_gottlieb 8y ago
Differentiation (of functions) is a product-preserving functor, which makes the Chain Rule the rule by which it respects function composition, which makes automatic differentiation a matter of writing out the syntax tree of functions and "folding it up" via a catamorphism (a generalized fold).
https://jtobin.io/ad-via-recursion-schemes https://jtobin.io/ad-via-recursion-schemes
Yes, really. I wasn't making that up. Automatic differentiation is a page or two of code given enough categorical background.