downhill-0.4.0.0: Reverse mode automatic differentiation
Safe HaskellSafe-Inferred
LanguageHaskell2010

Downhill.Linear.Lift

Description

While BackGrad is intended to be simple to construct manually, this module provides a way to do that with a bit less of boilerplate.

Synopsis

Lifts

lift1 :: forall z r a. BasicVector z => (z -> VecBuilder a) -> BackGrad r a -> BackGrad r z Source #

lift2 :: forall z r a b. BasicVector z => (z -> VecBuilder a) -> (z -> VecBuilder b) -> BackGrad r a -> BackGrad r b -> BackGrad r z Source #

lift3 :: forall z r a b c. BasicVector z => (z -> VecBuilder a) -> (z -> VecBuilder b) -> (z -> VecBuilder c) -> BackGrad r a -> BackGrad r b -> BackGrad r c -> BackGrad r z Source #

Dense lifts

lift1_dense :: (BasicVector v, BasicVector a) => (v -> a) -> BackGrad r a -> BackGrad r v Source #

lift2_dense :: (BasicVector v, BasicVector a, BasicVector b) => (v -> a) -> (v -> b) -> BackGrad r a -> BackGrad r b -> BackGrad r v Source #

lift3_dense :: (BasicVector v, BasicVector a, BasicVector b, BasicVector c) => (v -> a) -> (v -> b) -> (v -> c) -> BackGrad r a -> BackGrad r b -> BackGrad r c -> BackGrad r v Source #

Lifts for SparseVector

lift1_sparse :: forall r a z. BasicVector z => (VecBuilder z -> VecBuilder a) -> BackGrad r a -> BackGrad r z Source #

Same as sparseNode, included here for completeness.

lift2_sparse :: forall r a b z. BasicVector z => (VecBuilder z -> VecBuilder a) -> (VecBuilder z -> VecBuilder b) -> BackGrad r a -> BackGrad r b -> BackGrad r z Source #

lift3_sparse :: forall r a b c z. BasicVector z => (VecBuilder z -> VecBuilder a) -> (VecBuilder z -> VecBuilder b) -> (VecBuilder z -> VecBuilder c) -> BackGrad r a -> BackGrad r b -> BackGrad r c -> BackGrad r z Source #