ad-4.5.6: Automatic Differentiation
Copyright(c) Edward Kmett 2010-2021
LicenseBSD3
Maintainerekmett@gmail.com
Stabilityexperimental
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.AD.Rank1.Sparse.Double

Description

Higher order derivatives via a "dual number tower".

Synopsis

Documentation

data SparseDouble Source #

We only store partials in sorted order, so the map contained in a partial will only contain partials with equal or greater keys to that of the map in which it was found. This should be key for efficiently computing sparse hessians. there are only n + k - 1 choose k distinct nth partial derivatives of a function with k inputs.

Instances

Instances details
Jacobian SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Associated Types

type D SparseDouble Source #

Mode SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Associated Types

type Scalar SparseDouble Source #

Data SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SparseDouble -> c SparseDouble #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SparseDouble #

toConstr :: SparseDouble -> Constr #

dataTypeOf :: SparseDouble -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SparseDouble) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SparseDouble) #

gmapT :: (forall b. Data b => b -> b) -> SparseDouble -> SparseDouble #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SparseDouble -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SparseDouble -> r #

gmapQ :: (forall d. Data d => d -> u) -> SparseDouble -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SparseDouble -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SparseDouble -> m SparseDouble #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SparseDouble -> m SparseDouble #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SparseDouble -> m SparseDouble #

Enum SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Floating SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

RealFloat SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Num SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Fractional SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Real SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

RealFrac SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Show SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Erf SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

InvErf SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Eq SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Ord SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Grad SparseDouble [Double] (Double, [Double]) Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Grads SparseDouble (Cofree List Double) Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Grads i o => Grads (SparseDouble -> i) (Double -> o) Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Grad i o o' => Grad (SparseDouble -> i) (Double -> o) (Double -> o') Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Methods

pack :: (SparseDouble -> i) -> [SparseDouble] -> SparseDouble Source #

unpack :: ([Double] -> [Double]) -> Double -> o Source #

unpack' :: ([Double] -> (Double, [Double])) -> Double -> o' Source #

type D SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

type Scalar SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

auto :: Mode t => Scalar t -> t Source #

Embed a constant

Sparse Gradients

gradWith :: Traversable f => (Double -> Double -> b) -> (f SparseDouble -> SparseDouble) -> f Double -> f b Source #

gradWith' :: Traversable f => (Double -> Double -> b) -> (f SparseDouble -> SparseDouble) -> f Double -> (Double, f b) Source #

Variadic Gradients

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 auto calls you use when taking the gradient of a function that takes gradients!

class Grad i o o' | i -> o o', o -> i o', o' -> i o Source #

Minimal complete definition

pack, unpack, unpack'

Instances

Instances details
Grad SparseDouble [Double] (Double, [Double]) Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Grad i o o' => Grad (SparseDouble -> i) (Double -> o) (Double -> o') Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Methods

pack :: (SparseDouble -> i) -> [SparseDouble] -> SparseDouble Source #

unpack :: ([Double] -> [Double]) -> Double -> o Source #

unpack' :: ([Double] -> (Double, [Double])) -> Double -> o' Source #

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

Higher-Order Gradients

Variadic Higher-Order Gradients

class Grads i o | i -> o, o -> i Source #

Minimal complete definition

packs, unpacks

Instances

Instances details
Grads SparseDouble (Cofree List Double) Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Grads i o => Grads (SparseDouble -> i) (Double -> o) Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

vgrads :: Grads i o => i -> o Source #

Sparse Jacobians (synonyms)

jacobianWith :: (Traversable f, Functor g) => (Double -> Double -> b) -> (f SparseDouble -> g SparseDouble) -> f Double -> g (f b) Source #

jacobianWith' :: (Traversable f, Functor g) => (Double -> Double -> b) -> (f SparseDouble -> g SparseDouble) -> f Double -> g (Double, f b) Source #

Sparse Hessians

hessianF :: (Traversable f, Functor g) => (f SparseDouble -> g SparseDouble) -> f Double -> g (f (f Double)) Source #