Reverse-mode autodiff for Clojure
This package implements a proof-of-concept of reverse-mode autodiff in Clojure. It is mainly thought for learning Clojure, hence it offers minimal functionality, lacks (code) quality, and is probably buggy.
(require '[clad.core :refer [grad]])
(defn f [x y]
(/ (- 1.0 (Math/exp (- x)))
(+ 1.0 (Math/exp (- y)))))
(def g ((grad f 0) 2.0 1.0))
g
=> 0.0989
Simon Dirmeier sfyrbnd @ pm me