~/talk

Automatic Differentiation via Effects and Handlers in OCaml

Talkat ML 2024 · on Friday, 2024-09-06· [machine-learning]
links:none on file
slides:none on file

Implements four AD algorithms in OCaml 5.0 using effects and handlers to bubble up arithmetic and capture continuations, with a reverse-mode functor that pairs values with mutable accumulators and a grad helper for gradients and nested (higher‑order) derivatives. Extends to tensor ops via Owl (35 tensor/scalar primitives) and runs MLBench GMM tests (N=1k, 10k, KD varied). Microbenchmarks show correct O(n) scaling and about a 8× slowdown over raw evaluation; macro results are competitive with dynamic systems, second only to PyTorch/TensorFlow*.

AI-written summary · about

  1. 0:00Introduction
  2. 0:22Automatic differentiation
  3. 1:25Forward/reverse chain rule
  4. 5:14Effects and handlers
  5. 7:24Smooth effect
  6. 10:31Floating-point operations
  7. 13:24Reverse mode with handlers
  8. 16:29Computing derivatives with grad
  9. 18:37Reverse mode performance
  10. 19:18Micro benchmarks
  11. 20:41Macro benchmarks
  12. 24:55Conclusion
  13. 26:37Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.