Reverse-mode algorithmic differentiation using effect handlers in OCaml 5
github.com
github.com
Here's a much better introduction, that links you to an industrial-level autodiff library [1].
Is it faster/terser/more easily extensible?
How would you make this extensible?
It seems that adding new functions besides add and mult would require modifications to `run`, right?
The current effects syntax is very rough. It’s considered an experimental feature by the compiler team. Currently effects handlers are exposed to users as a thin wrapper on top of their implementations in the runtime. A better syntax will come but the Ocaml dev team wants to take the time necessary to get it right.
>is it ever required for applications to implement their own differentation for something specific?
If you want to do backpropagation you need to manually or automatically calculate derivatives woth regards to your parameters.
I've had to define my own gradients in Flux before, but that was two years ago, maybe things have improved?
In any case AD in general is useful for NNs if you want to implement a novel layer. Of course you could instead derive back propagation by algebraic or manual differentiation instead.