hasktorch-0.2.0.0: Functional differentiable programming in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.Typed.NN.Recurrent.Cell.LSTM

Synopsis

Documentation

data LSTMCellSpec (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) Source #

A specification for a long, short-term memory (LSTM) cell.

Constructors

LSTMCellSpec

Weights and biases are drawn from the standard normal distibution (having mean 0 and variance 1)

Instances

Instances details
Bounded (LSTMCellSpec inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

minBound :: LSTMCellSpec inputDim hiddenDim dtype device Source #

maxBound :: LSTMCellSpec inputDim hiddenDim dtype device Source #

Enum (LSTMCellSpec inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

succ :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device Source #

pred :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device Source #

toEnum :: Int -> LSTMCellSpec inputDim hiddenDim dtype device Source #

fromEnum :: LSTMCellSpec inputDim hiddenDim dtype device -> Int Source #

enumFrom :: LSTMCellSpec inputDim hiddenDim dtype device -> [LSTMCellSpec inputDim hiddenDim dtype device] Source #

enumFromThen :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> [LSTMCellSpec inputDim hiddenDim dtype device] Source #

enumFromTo :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> [LSTMCellSpec inputDim hiddenDim dtype device] Source #

enumFromThenTo :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> [LSTMCellSpec inputDim hiddenDim dtype device] Source #

Generic (LSTMCellSpec inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Associated Types

type Rep (LSTMCellSpec inputDim hiddenDim dtype device) :: Type -> Type Source #

Methods

from :: LSTMCellSpec inputDim hiddenDim dtype device -> Rep (LSTMCellSpec inputDim hiddenDim dtype device) x Source #

to :: Rep (LSTMCellSpec inputDim hiddenDim dtype device) x -> LSTMCellSpec inputDim hiddenDim dtype device Source #

Show (LSTMCellSpec inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

showsPrec :: Int -> LSTMCellSpec inputDim hiddenDim dtype device -> ShowS Source #

show :: LSTMCellSpec inputDim hiddenDim dtype device -> String Source #

showList :: [LSTMCellSpec inputDim hiddenDim dtype device] -> ShowS Source #

Eq (LSTMCellSpec inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

(==) :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> Bool Source #

(/=) :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> Bool Source #

Ord (LSTMCellSpec inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

compare :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> Ordering Source #

(<) :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> Bool Source #

(<=) :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> Bool Source #

(>) :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> Bool Source #

(>=) :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> Bool Source #

max :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device Source #

min :: LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device -> LSTMCellSpec inputDim hiddenDim dtype device Source #

(KnownDevice device, KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, RandDTypeIsValid device dtype) => Randomizable (LSTMCellSpec inputDim hiddenDim dtype device) (LSTMCell inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

sample :: LSTMCellSpec inputDim hiddenDim dtype device -> IO (LSTMCell inputDim hiddenDim dtype device) Source #

type Rep (LSTMCellSpec inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

type Rep (LSTMCellSpec inputDim hiddenDim dtype device) = D1 ('MetaData "LSTMCellSpec" "Torch.Typed.NN.Recurrent.Cell.LSTM" "hasktorch-0.2.0.0-F6yFRaDiRF49lpq95SVuR8" 'False) (C1 ('MetaCons "LSTMCellSpec" 'PrefixI 'False) (U1 :: Type -> Type))

data LSTMCell (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) Source #

A long, short-term memory cell.

Constructors

LSTMCell 

Fields

Instances

Instances details
Generic (LSTMCell inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Associated Types

type Rep (LSTMCell inputDim hiddenDim dtype device) :: Type -> Type Source #

Methods

from :: LSTMCell inputDim hiddenDim dtype device -> Rep (LSTMCell inputDim hiddenDim dtype device) x Source #

to :: Rep (LSTMCell inputDim hiddenDim dtype device) x -> LSTMCell inputDim hiddenDim dtype device Source #

Show (LSTMCell inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

showsPrec :: Int -> LSTMCell inputDim hiddenDim dtype device -> ShowS Source #

show :: LSTMCell inputDim hiddenDim dtype device -> String Source #

showList :: [LSTMCell inputDim hiddenDim dtype device] -> ShowS Source #

Parameterized (LSTMCell inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Associated Types

type Parameters (LSTMCell inputDim hiddenDim dtype device) :: [Type] Source #

Methods

flattenParameters :: LSTMCell inputDim hiddenDim dtype device -> HList (Parameters (LSTMCell inputDim hiddenDim dtype device)) Source #

replaceParameters :: LSTMCell inputDim hiddenDim dtype device -> HList (Parameters (LSTMCell inputDim hiddenDim dtype device)) -> LSTMCell inputDim hiddenDim dtype device Source #

(KnownDevice device, KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, RandDTypeIsValid device dtype) => Randomizable (LSTMCellSpec inputDim hiddenDim dtype device) (LSTMCell inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

Methods

sample :: LSTMCellSpec inputDim hiddenDim dtype device -> IO (LSTMCell inputDim hiddenDim dtype device) Source #

type Rep (LSTMCell inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

type Rep (LSTMCell inputDim hiddenDim dtype device) = D1 ('MetaData "LSTMCell" "Torch.Typed.NN.Recurrent.Cell.LSTM" "hasktorch-0.2.0.0-F6yFRaDiRF49lpq95SVuR8" 'False) (C1 ('MetaCons "LSTMCell" 'PrefixI 'True) ((S1 ('MetaSel ('Just "lstmCell_w_ih") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[4 * hiddenDim, inputDim])) :*: S1 ('MetaSel ('Just "lstmCell_w_hh") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[4 * hiddenDim, hiddenDim]))) :*: (S1 ('MetaSel ('Just "lstmCell_b_ih") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[4 * hiddenDim])) :*: S1 ('MetaSel ('Just "lstmCell_b_hh") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[4 * hiddenDim])))))
type Parameters (LSTMCell inputDim hiddenDim dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Recurrent.Cell.LSTM

type Parameters (LSTMCell inputDim hiddenDim dtype device) = GParameters (Rep (LSTMCell inputDim hiddenDim dtype device))

lstmCellForward Source #

Arguments

:: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) 
=> LSTMCell inputDim hiddenDim dtype device

The cell

-> (Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])

The current (Hidden, Cell) state

-> Tensor device dtype '[batchSize, inputDim]

The input

-> (Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])

The subsequent (Hidden, Cell) state

A single recurrent step of an LSTMCell

lstmCellFold Source #

Arguments

:: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) 
=> LSTMCell inputDim hiddenDim dtype device 
-> (Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])

The initial (Hidden, Cell) state

-> [Tensor device dtype '[batchSize, inputDim]]

The list of inputs

-> (Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])

The final (Hidden, Cell) state

foldl' for lists of tensors unsing an LSTMCell

lstmCellScan Source #

Arguments

:: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) 
=> LSTMCell inputDim hiddenDim dtype device 
-> (Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])

The initial (Hidden, Cell) state

-> [Tensor device dtype '[batchSize, inputDim]]

The list of inputs

-> [(Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])]

All subsequent (Hidden, Cell) states

scanl' for lists of tensors unsing an LSTMCell