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

Safe HaskellNone
LanguageHaskell2010

Backprop.Learn.Model.Neural.LSTM

Contents

Synopsis

LSTM

lstm :: (KnownNat i, KnownNat o) => Model (Just (LSTMp i o)) (Just (R o :# R o)) (R i) (R o) Source #

data LSTMp (i :: Nat) (o :: Nat) Source #

LSTM layer parmateters

Constructors

LSTMp 

Fields

Instances
(PrimMonad m, KnownNat i, KnownNat o) => LinearInPlace m Double (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(.+.=) :: Ref m (LSTMp i o) -> LSTMp i o -> m () #

(.*=) :: Ref m (LSTMp i o) -> Double -> m () #

(.*+=) :: Ref m (LSTMp i o) -> (Double, LSTMp i o) -> m () #

KnownNat o => Linear Double (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(.+.) :: LSTMp i o -> LSTMp i o -> LSTMp i o #

zeroL :: LSTMp i o #

(.*) :: Double -> LSTMp i o -> LSTMp i o #

KnownNat o => Metric Double (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(<.>) :: LSTMp i o -> LSTMp i o -> Double #

norm_inf :: LSTMp i o -> Double #

norm_0 :: LSTMp i o -> Double #

norm_1 :: LSTMp i o -> Double #

norm_2 :: LSTMp i o -> Double #

quadrance :: LSTMp i o -> Double #

(PrimMonad m, KnownNat i, KnownNat o) => Mutable m (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Associated Types

type Ref m (LSTMp i o) = (v :: Type) #

Methods

thawRef :: LSTMp i o -> m (Ref m (LSTMp i o)) #

freezeRef :: Ref m (LSTMp i o) -> m (LSTMp i o) #

copyRef :: Ref m (LSTMp i o) -> LSTMp i o -> m () #

modifyRef :: Ref m (LSTMp i o) -> (LSTMp i o -> LSTMp i o) -> m () #

modifyRef' :: Ref m (LSTMp i o) -> (LSTMp i o -> LSTMp i o) -> m () #

updateRef :: Ref m (LSTMp i o) -> (LSTMp i o -> (LSTMp i o, b)) -> m b #

updateRef' :: Ref m (LSTMp i o) -> (LSTMp i o -> (LSTMp i o, b)) -> m b #

(PrimMonad m, KnownNat i, KnownNat o) => Learnable m (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

(KnownNat i, KnownNat o) => Floating (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

pi :: LSTMp i o #

exp :: LSTMp i o -> LSTMp i o #

log :: LSTMp i o -> LSTMp i o #

sqrt :: LSTMp i o -> LSTMp i o #

(**) :: LSTMp i o -> LSTMp i o -> LSTMp i o #

logBase :: LSTMp i o -> LSTMp i o -> LSTMp i o #

sin :: LSTMp i o -> LSTMp i o #

cos :: LSTMp i o -> LSTMp i o #

tan :: LSTMp i o -> LSTMp i o #

asin :: LSTMp i o -> LSTMp i o #

acos :: LSTMp i o -> LSTMp i o #

atan :: LSTMp i o -> LSTMp i o #

sinh :: LSTMp i o -> LSTMp i o #

cosh :: LSTMp i o -> LSTMp i o #

tanh :: LSTMp i o -> LSTMp i o #

asinh :: LSTMp i o -> LSTMp i o #

acosh :: LSTMp i o -> LSTMp i o #

atanh :: LSTMp i o -> LSTMp i o #

log1p :: LSTMp i o -> LSTMp i o #

expm1 :: LSTMp i o -> LSTMp i o #

log1pexp :: LSTMp i o -> LSTMp i o #

log1mexp :: LSTMp i o -> LSTMp i o #

(KnownNat i, KnownNat o) => Fractional (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(/) :: LSTMp i o -> LSTMp i o -> LSTMp i o #

recip :: LSTMp i o -> LSTMp i o #

fromRational :: Rational -> LSTMp i o #

(KnownNat i, KnownNat o) => Num (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(+) :: LSTMp i o -> LSTMp i o -> LSTMp i o #

(-) :: LSTMp i o -> LSTMp i o -> LSTMp i o #

(*) :: LSTMp i o -> LSTMp i o -> LSTMp i o #

negate :: LSTMp i o -> LSTMp i o #

abs :: LSTMp i o -> LSTMp i o #

signum :: LSTMp i o -> LSTMp i o #

fromInteger :: Integer -> LSTMp i o #

KnownNat o => Show (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

showsPrec :: Int -> LSTMp i o -> ShowS #

show :: LSTMp i o -> String #

showList :: [LSTMp i o] -> ShowS #

Generic (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Associated Types

type Rep (LSTMp i o) :: Type -> Type #

Methods

from :: LSTMp i o -> Rep (LSTMp i o) x #

to :: Rep (LSTMp i o) x -> LSTMp i o #

NFData (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

rnf :: LSTMp i o -> () #

KnownNat o => Backprop (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

zero :: LSTMp i o -> LSTMp i o #

add :: LSTMp i o -> LSTMp i o -> LSTMp i o #

one :: LSTMp i o -> LSTMp i o #

KnownNat o => Binary (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

put :: LSTMp i o -> Put #

get :: Get (LSTMp i o) #

putList :: [LSTMp i o] -> Put #

KnownNat o => Regularize (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

rnorm_1 :: LSTMp i o -> Double Source #

rnorm_2 :: LSTMp i o -> Double Source #

lasso :: Double -> LSTMp i o -> LSTMp i o Source #

ridge :: Double -> LSTMp i o -> LSTMp i o Source #

(KnownNat i, KnownNat o) => Initialize (LSTMp i o) Source #

Forget biases initialized to 1

Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

initialize :: (ContGen d, PrimMonad m) => d -> Gen (PrimState m) -> m (LSTMp i o) Source #

type Ref m (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

type Ref m (LSTMp i o) = GRef m (LSTMp i o)
type Rep (LSTMp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

type Rep (LSTMp i o) = D1 (MetaData "LSTMp" "Backprop.Learn.Model.Neural.LSTM" "backprop-learn-0.1.0.0-LYs2l1OGpKTGmGWQXOoOXm" False) (C1 (MetaCons "LSTMp" PrefixI True) ((S1 (MetaSel (Just "_lstmForget") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (FCp (i + o) o)) :*: S1 (MetaSel (Just "_lstmInput") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (FCp (i + o) o))) :*: (S1 (MetaSel (Just "_lstmUpdate") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (FCp (i + o) o)) :*: S1 (MetaSel (Just "_lstmOutput") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (FCp (i + o) o)))))

lstmForget :: forall i o. Lens' (LSTMp i o) (FCp ((+) i o) o) Source #

lstmInput :: forall i o. Lens' (LSTMp i o) (FCp ((+) i o) o) Source #

lstmUpdate :: forall i o. Lens' (LSTMp i o) (FCp ((+) i o) o) Source #

lstmOutput :: forall i o. Lens' (LSTMp i o) (FCp ((+) i o) o) Source #

reshapeLSTMpInput :: (ContGen d, PrimMonad m, KnownNat i, KnownNat i', KnownNat o) => d -> Gen (PrimState m) -> LSTMp i o -> m (LSTMp i' o) Source #

reshapeLSTMpOutput :: (ContGen d, PrimMonad m, KnownNat i, KnownNat o, KnownNat o') => d -> Gen (PrimState m) -> LSTMp i o -> m (LSTMp i o') Source #

lstm' :: (KnownNat i, KnownNat o) => Model (Just (LSTMp i o)) (Just (R o)) (R (i + o)) (R o) Source #

Stateless version of lstm that takes the "previous input" as a part of the input vector.

GRU

data GRUp (i :: Nat) (o :: Nat) Source #

GRU layer parmateters

Constructors

GRUp 

Fields

Instances
(KnownNat i, KnownNat o, Mutable m (GRUp i o)) => LinearInPlace m Double (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(.+.=) :: Ref m (GRUp i o) -> GRUp i o -> m () #

(.*=) :: Ref m (GRUp i o) -> Double -> m () #

(.*+=) :: Ref m (GRUp i o) -> (Double, GRUp i o) -> m () #

KnownNat o => Linear Double (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(.+.) :: GRUp i o -> GRUp i o -> GRUp i o #

zeroL :: GRUp i o #

(.*) :: Double -> GRUp i o -> GRUp i o #

KnownNat o => Metric Double (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(<.>) :: GRUp i o -> GRUp i o -> Double #

norm_inf :: GRUp i o -> Double #

norm_0 :: GRUp i o -> Double #

norm_1 :: GRUp i o -> Double #

norm_2 :: GRUp i o -> Double #

quadrance :: GRUp i o -> Double #

(PrimMonad m, KnownNat i, KnownNat o) => Mutable m (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Associated Types

type Ref m (GRUp i o) = (v :: Type) #

Methods

thawRef :: GRUp i o -> m (Ref m (GRUp i o)) #

freezeRef :: Ref m (GRUp i o) -> m (GRUp i o) #

copyRef :: Ref m (GRUp i o) -> GRUp i o -> m () #

modifyRef :: Ref m (GRUp i o) -> (GRUp i o -> GRUp i o) -> m () #

modifyRef' :: Ref m (GRUp i o) -> (GRUp i o -> GRUp i o) -> m () #

updateRef :: Ref m (GRUp i o) -> (GRUp i o -> (GRUp i o, b)) -> m b #

updateRef' :: Ref m (GRUp i o) -> (GRUp i o -> (GRUp i o, b)) -> m b #

(KnownNat i, KnownNat o, PrimMonad m) => Learnable m (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

(KnownNat i, KnownNat o) => Floating (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

pi :: GRUp i o #

exp :: GRUp i o -> GRUp i o #

log :: GRUp i o -> GRUp i o #

sqrt :: GRUp i o -> GRUp i o #

(**) :: GRUp i o -> GRUp i o -> GRUp i o #

logBase :: GRUp i o -> GRUp i o -> GRUp i o #

sin :: GRUp i o -> GRUp i o #

cos :: GRUp i o -> GRUp i o #

tan :: GRUp i o -> GRUp i o #

asin :: GRUp i o -> GRUp i o #

acos :: GRUp i o -> GRUp i o #

atan :: GRUp i o -> GRUp i o #

sinh :: GRUp i o -> GRUp i o #

cosh :: GRUp i o -> GRUp i o #

tanh :: GRUp i o -> GRUp i o #

asinh :: GRUp i o -> GRUp i o #

acosh :: GRUp i o -> GRUp i o #

atanh :: GRUp i o -> GRUp i o #

log1p :: GRUp i o -> GRUp i o #

expm1 :: GRUp i o -> GRUp i o #

log1pexp :: GRUp i o -> GRUp i o #

log1mexp :: GRUp i o -> GRUp i o #

(KnownNat i, KnownNat o) => Fractional (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(/) :: GRUp i o -> GRUp i o -> GRUp i o #

recip :: GRUp i o -> GRUp i o #

fromRational :: Rational -> GRUp i o #

(KnownNat i, KnownNat o) => Num (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

(+) :: GRUp i o -> GRUp i o -> GRUp i o #

(-) :: GRUp i o -> GRUp i o -> GRUp i o #

(*) :: GRUp i o -> GRUp i o -> GRUp i o #

negate :: GRUp i o -> GRUp i o #

abs :: GRUp i o -> GRUp i o #

signum :: GRUp i o -> GRUp i o #

fromInteger :: Integer -> GRUp i o #

KnownNat o => Show (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

showsPrec :: Int -> GRUp i o -> ShowS #

show :: GRUp i o -> String #

showList :: [GRUp i o] -> ShowS #

Generic (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Associated Types

type Rep (GRUp i o) :: Type -> Type #

Methods

from :: GRUp i o -> Rep (GRUp i o) x #

to :: Rep (GRUp i o) x -> GRUp i o #

NFData (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

rnf :: GRUp i o -> () #

KnownNat o => Backprop (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

zero :: GRUp i o -> GRUp i o #

add :: GRUp i o -> GRUp i o -> GRUp i o #

one :: GRUp i o -> GRUp i o #

KnownNat o => Binary (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

put :: GRUp i o -> Put #

get :: Get (GRUp i o) #

putList :: [GRUp i o] -> Put #

KnownNat o => Regularize (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

rnorm_1 :: GRUp i o -> Double Source #

rnorm_2 :: GRUp i o -> Double Source #

lasso :: Double -> GRUp i o -> GRUp i o Source #

ridge :: Double -> GRUp i o -> GRUp i o Source #

KnownNat o => Initialize (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

Methods

initialize :: (ContGen d, PrimMonad m) => d -> Gen (PrimState m) -> m (GRUp i o) Source #

type Ref m (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

type Ref m (GRUp i o) = GRef m (GRUp i o)
type Rep (GRUp i o) Source # 
Instance details

Defined in Backprop.Learn.Model.Neural.LSTM

type Rep (GRUp i o) = D1 (MetaData "GRUp" "Backprop.Learn.Model.Neural.LSTM" "backprop-learn-0.1.0.0-LYs2l1OGpKTGmGWQXOoOXm" False) (C1 (MetaCons "GRUp" PrefixI True) (S1 (MetaSel (Just "_gruMemory") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (FCp (i + o) o)) :*: (S1 (MetaSel (Just "_gruUpdate") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (FCp (i + o) o)) :*: S1 (MetaSel (Just "_gruOutput") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (FCp (i + o) o)))))

gruMemory :: forall i o. Lens' (GRUp i o) (FCp ((+) i o) o) Source #

gruUpdate :: forall i o. Lens' (GRUp i o) (FCp ((+) i o) o) Source #

gruOutput :: forall i o. Lens' (GRUp i o) (FCp ((+) i o) o) Source #

gru' :: forall i o. (KnownNat i, KnownNat o) => Model (Just (GRUp i o)) Nothing (R (i + o)) (R o) Source #

Stateless version of gru that takes the "previous input" as a part of the input vector.