Skip to content

Instantly share code, notes, and snippets.

@willtebbutt
willtebbutt / toy_chainrules_rmad.jl
Last active Apr 16, 2019
Toy tape-based reverse-mode AD with minimal Cassette usage.
View toy_chainrules_rmad.jl
#
# This uses the Nabla.jl-style interception mechanism whereby
# we wrap things that are to be differentiated w.r.t. in a
# thin wrapper. There are lots of thing that you can't
# propoagate derivative information through with this kind of
# approach without quite a lot of extra machinery, but the
# examples at the bottom do work.
#
using ChainRules, Cassette