ad-3.2.1: Automatic Differentiation

Portabilitynon-portable
Stabilityexperimental
Maintainerekmett@gmail.com
Safe HaskellNone

Numeric.AD.Variadic

Contents

Description

Variadic combinators for variadic mixed-mode automatic differentiation.

Unfortunately, variadicity comes at the expense of being able to use quantification to avoid sensitivity confusion, so be careful when counting the number of lift you use when taking the gradient of a function that takes gradients!

Synopsis

Reverse-mode variadic gradient

class Num a => Grad i o o' a | i -> a o o', o -> a i o', o' -> a i oSource

Instances

Num a => Grad (AD Reverse a) [a] (a, [a]) a 
(Num a, Grad i o o' a) => Grad (AD Reverse a -> i) (a -> o) (a -> o') a 

vgrad :: Grad i o o' a => i -> oSource

vgrad' :: Grad i o o' a => i -> o'Source

Sparse forward mode variadic jet

class Num a => Grads i o a | i -> a o, o -> a iSource

Instances

(Num a, Grads i o a) => Grads (AD Sparse a -> i) (a -> o) a 
Num a => Grads (AD Sparse a) (Cofree [] a) a 

vgrads :: Grads i o a => i -> oSource