Copyright | (c) Edward Kmett 2010-2021 |
---|---|
License | BSD3 |
Maintainer | ekmett@gmail.com |
Stability | experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Dense forward mode automatic differentiation with representable functors.
Synopsis
- data Repr f a
- auto :: Mode t => Scalar t -> t
- grad :: (Representable f, Eq (Rep f), Num a) => (f (Repr f a) -> Repr f a) -> f a -> f a
- grad' :: (Representable f, Eq (Rep f), Num a) => (f (Repr f a) -> Repr f a) -> f a -> (a, f a)
- gradWith :: (Representable f, Eq (Rep f), Num a) => (a -> a -> b) -> (f (Repr f a) -> Repr f a) -> f a -> f b
- gradWith' :: (Representable f, Eq (Rep f), Num a) => (a -> a -> b) -> (f (Repr f a) -> Repr f a) -> f a -> (a, f b)
- jacobian :: (Representable f, Eq (Rep f), Functor g, Num a) => (f (Repr f a) -> g (Repr f a)) -> f a -> g (f a)
- jacobian' :: (Representable f, Eq (Rep f), Functor g, Num a) => (f (Repr f a) -> g (Repr f a)) -> f a -> g (a, f a)
- jacobianWith :: (Representable f, Eq (Rep f), Functor g, Num a) => (a -> a -> b) -> (f (Repr f a) -> g (Repr f a)) -> f a -> g (f b)
- jacobianWith' :: (Representable f, Eq (Rep f), Functor g, Num a) => (a -> a -> b) -> (f (Repr f a) -> g (Repr f a)) -> f a -> g (a, f b)
Documentation
Instances
Sparse Gradients
grad' :: (Representable f, Eq (Rep f), Num a) => (f (Repr f a) -> Repr f a) -> f a -> (a, f a) Source #
gradWith :: (Representable f, Eq (Rep f), Num a) => (a -> a -> b) -> (f (Repr f a) -> Repr f a) -> f a -> f b Source #
gradWith' :: (Representable f, Eq (Rep f), Num a) => (a -> a -> b) -> (f (Repr f a) -> Repr f a) -> f a -> (a, f b) Source #
Sparse Jacobians (synonyms)
jacobian :: (Representable f, Eq (Rep f), Functor g, Num a) => (f (Repr f a) -> g (Repr f a)) -> f a -> g (f a) Source #
jacobian' :: (Representable f, Eq (Rep f), Functor g, Num a) => (f (Repr f a) -> g (Repr f a)) -> f a -> g (a, f a) Source #
jacobianWith :: (Representable f, Eq (Rep f), Functor g, Num a) => (a -> a -> b) -> (f (Repr f a) -> g (Repr f a)) -> f a -> g (f b) Source #
jacobianWith' :: (Representable f, Eq (Rep f), Functor g, Num a) => (a -> a -> b) -> (f (Repr f a) -> g (Repr f a)) -> f a -> g (a, f b) Source #