Portability | GHC only |
---|---|
Stability | experimental |
Maintainer | ekmett@gmail.com |
Safe Haskell | None |
Reverse-Mode Automatic Differentiation using a single tape.
This version uses Data.Reflection
to update a single tape.
This is asymptotically faster than using Reverse
, which
is forced to reify and topologically sort the graph, but it is
less friendly to the use of sparks.
- class Primal v => Var v where
- bind :: (Traversable f, Var v) => f a -> (f (v a), (Int, Int))
- unbind :: (Functor f, Var v) => f (v a) -> Array Int a -> f a
- unbindMap :: (Functor f, Var v, Num a) => f (v a) -> IntMap a -> f a
- unbindWith :: (Functor f, Var v, Num a) => (a -> b -> c) -> f (v a) -> Array Int b -> f c
- unbindMapWithDefault :: (Functor f, Var v, Num a) => b -> (a -> b -> c) -> f (v a) -> IntMap b -> f c
- data Variable a = Variable a !Int
- vary :: Var f => Variable a -> f a