ad-4.1: Automatic Differentiation

PortabilityGHC only
Stabilityexperimental
Maintainerekmett@gmail.com
Safe HaskellNone

Numeric.AD.Mode

Contents

Description

 

Synopsis

AD modes

class (Num t, Num (Scalar t)) => Mode t whereSource

Methods

isKnownConstant :: t -> BoolSource

allowed to return False for items with a zero derivative, but we'll give more NaNs than strictly necessary

isKnownZero :: t -> BoolSource

allowed to return False for zero, but we give more NaN's than strictly necessary then

auto :: Scalar t -> tSource

Embed a constant

(*^) :: Scalar t -> t -> tSource

Scalar-vector multiplication

(^*) :: t -> Scalar t -> tSource

Vector-scalar multiplication

(^/) :: Fractional (Scalar t) => t -> Scalar t -> tSource

Scalar division

zero :: tSource

zero = lift 0

Instances

Mode (ForwardDouble s) 
(Mode t, Mode (Scalar t)) => Mode (On t) 
Num a => Mode (Tower a s) 
Num a => Mode (Id a s) 
Num a => Mode (Sparse a s) 
(Num a, Reifies * s Tape) => Mode (Reverse a s) 
Num a => Mode (Kahn a s) 
Num a => Mode (Forward a s) 
(Mode a, Mode b, Chosen s, ~ * (Scalar a) (Scalar b)) => Mode (Or a b s) 
(Num a, Traversable f) => Mode (Dense f a s) 

type family Scalar t :: *Source