Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LSTMCellSpec (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) = LSTMCellSpec
- data LSTMCell (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) = LSTMCell {
- lstmCell_w_ih :: Parameter device dtype '[4 * hiddenDim, inputDim]
- lstmCell_w_hh :: Parameter device dtype '[4 * hiddenDim, hiddenDim]
- lstmCell_b_ih :: Parameter device dtype '[4 * hiddenDim]
- lstmCell_b_hh :: Parameter device dtype '[4 * hiddenDim]
- lstmCellForward :: 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]) -> Tensor device dtype '[batchSize, inputDim] -> (Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])
- lstmCellFold :: 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]) -> [Tensor device dtype '[batchSize, inputDim]] -> (Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])
- lstmCellScan :: 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]) -> [Tensor device dtype '[batchSize, inputDim]] -> [(Tensor device dtype '[batchSize, hiddenDim], Tensor device dtype '[batchSize, hiddenDim])]
Documentation
data LSTMCellSpec (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) Source #
A specification for a long, short-term memory (LSTM) cell.
LSTMCellSpec | Weights and biases are drawn from the standard normal distibution (having mean 0 and variance 1) |
Instances
Bounded (LSTMCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM minBound :: LSTMCellSpec inputDim hiddenDim dtype device Source # maxBound :: LSTMCellSpec inputDim hiddenDim dtype device Source # | |
Enum (LSTMCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM 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 # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM 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 # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM | |
Eq (LSTMCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM (==) :: 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 # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM 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 # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM | |
type Rep (LSTMCellSpec inputDim hiddenDim dtype device) Source # | |
data LSTMCell (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) Source #
A long, short-term memory cell.
LSTMCell | |
|
Instances
Generic (LSTMCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM | |
Show (LSTMCell inputDim hiddenDim dtype device) Source # | |
Parameterized (LSTMCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM type Parameters (LSTMCell inputDim hiddenDim dtype device) :: [Type] Source # 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 # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM | |
type Rep (LSTMCell inputDim hiddenDim dtype device) Source # | |
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 # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM type Parameters (LSTMCell inputDim hiddenDim dtype device) = GParameters (Rep (LSTMCell inputDim hiddenDim dtype device)) |
:: 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
:: 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
:: 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