backprop-learn-0.1.0.0: Combinators and useful tools for ANNs using the backprop library

Safe HaskellNone
LanguageHaskell2010

Backprop.Learn.Model.Combinator

Contents

Synopsis

Tuple-based Composition

(~>) :: forall p q s t a b c. (PureProd Maybe p, PureProd Maybe q, PureProd Maybe s, PureProd Maybe t, AllConstrainedProd Backprop p, AllConstrainedProd Backprop q, AllConstrainedProd Backprop s, AllConstrainedProd Backprop t) => Model p s a b -> Model q t b c -> Model (p :#? q) (s :#? t) a c infixr 8 Source #

Compose two Models one after the other, in reverse composition order

(<~) :: forall p q s t a b c. (PureProd Maybe p, PureProd Maybe q, PureProd Maybe s, PureProd Maybe t, AllConstrainedProd Backprop p, AllConstrainedProd Backprop q, AllConstrainedProd Backprop s, AllConstrainedProd Backprop t) => Model p s b c -> Model q t a b -> Model (p :#? q) (s :#? t) a c infixr 8 Source #

Compose two Models one after the other.

List-based Composition

type LModel ps ss a b = Model (Just (T ps)) (Just (T ss)) a b Source #

Model where parameters and states are heterogeneous lists (T), making for more seamless composition.

(#:) :: forall p ps s ss a b c. (AllConstrainedProd Backprop p, AllConstrainedProd Backprop s, ReifyConstraint Backprop TF ps, ReifyConstraint Backprop TF ss, RMap ss, RApply ss, RMap ps, RApply ps, PureProd Maybe p, PureProd Maybe s) => Model p s b c -> LModel ps ss a b -> LModel (MaybeToList p ++ ps) (MaybeToList s ++ ss) a c infixr 5 Source #

Cons a model to the end of a chain of LModel compositions. Can be used with nilLM.

nilLM :: Model (Just (T '[])) (Just (T '[])) a a Source #

Identity of #++

(#++) :: forall ps qs ss ts a b c. (Learnables ps, Learnables qs, Learnables ss, Learnables ts, Learnables (ps ++ qs), Learnables (ss ++ ts)) => LModel ps ss b c -> LModel qs ts a b -> LModel (ps ++ qs) (ss ++ ts) a c infixr 5 Source #

Compose two LModels

liftLM :: forall p s a b. (SingI p, AllConstrainedProd Backprop p, SingI s, AllConstrainedProd Backprop s) => Model p s a b -> LModel (MaybeToList p) (MaybeToList s) a b Source #

Lift a normal Model to a LModel with a singleton list parameter/state if 'Just, or an empty list if 'Nothing. Essentially prepares a model to be used with #~ and nilLM.

Misc

feedback Source #

Return a model that loops a model ("feed") repeatedly onto itself, with a model to provide the back loop.

feedbackTrace Source #

feedback, but tracing and observing all of the intermediate values.