Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data GRUCellSpec (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) = GRUCellSpec
- data GRUCell (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) = GRUCell {
- gruCell_w_ih :: Parameter device dtype '[3 * hiddenDim, inputDim]
- gruCell_w_hh :: Parameter device dtype '[3 * hiddenDim, hiddenDim]
- gruCell_b_ih :: Parameter device dtype '[3 * hiddenDim]
- gruCell_b_hh :: Parameter device dtype '[3 * hiddenDim]
- gruCellForward :: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) => GRUCell inputDim hiddenDim dtype device -> Tensor device dtype '[batchSize, hiddenDim] -> Tensor device dtype '[batchSize, inputDim] -> Tensor device dtype '[batchSize, hiddenDim]
- gruFold :: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) => GRUCell inputDim hiddenDim dtype device -> Tensor device dtype '[batchSize, hiddenDim] -> [Tensor device dtype '[batchSize, inputDim]] -> Tensor device dtype '[batchSize, hiddenDim]
- gruCellScan :: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) => GRUCell inputDim hiddenDim dtype device -> Tensor device dtype '[batchSize, hiddenDim] -> [Tensor device dtype '[batchSize, inputDim]] -> [Tensor device dtype '[batchSize, hiddenDim]]
Documentation
data GRUCellSpec (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) Source #
A specification for a gated recurrent unit (GRU) cell.
GRUCellSpec | Weights and biases are drawn from the standard normal distibution (having mean 0 and variance 1) |
Instances
Bounded (GRUCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU minBound :: GRUCellSpec inputDim hiddenDim dtype device Source # maxBound :: GRUCellSpec inputDim hiddenDim dtype device Source # | |
Enum (GRUCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU succ :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device Source # pred :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device Source # toEnum :: Int -> GRUCellSpec inputDim hiddenDim dtype device Source # fromEnum :: GRUCellSpec inputDim hiddenDim dtype device -> Int Source # enumFrom :: GRUCellSpec inputDim hiddenDim dtype device -> [GRUCellSpec inputDim hiddenDim dtype device] Source # enumFromThen :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> [GRUCellSpec inputDim hiddenDim dtype device] Source # enumFromTo :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> [GRUCellSpec inputDim hiddenDim dtype device] Source # enumFromThenTo :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> [GRUCellSpec inputDim hiddenDim dtype device] Source # | |
Generic (GRUCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU from :: GRUCellSpec inputDim hiddenDim dtype device -> Rep (GRUCellSpec inputDim hiddenDim dtype device) x Source # to :: Rep (GRUCellSpec inputDim hiddenDim dtype device) x -> GRUCellSpec inputDim hiddenDim dtype device Source # | |
Show (GRUCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU | |
Eq (GRUCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU (==) :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> Bool Source # (/=) :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> Bool Source # | |
Ord (GRUCellSpec inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU compare :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> Ordering Source # (<) :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> Bool Source # (<=) :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> Bool Source # (>) :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> Bool Source # (>=) :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> Bool Source # max :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device Source # min :: GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device -> GRUCellSpec inputDim hiddenDim dtype device Source # | |
(KnownDevice device, KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, RandDTypeIsValid device dtype) => Randomizable (GRUCellSpec inputDim hiddenDim dtype device) (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU | |
type Rep (GRUCellSpec inputDim hiddenDim dtype device) Source # | |
data GRUCell (inputDim :: Nat) (hiddenDim :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) Source #
A gated recurrent unit (GRU) cell.
GRUCell | |
|
Instances
Generic (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU | |
Show (GRUCell inputDim hiddenDim dtype device) Source # | |
Parameterized (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU type Parameters (GRUCell inputDim hiddenDim dtype device) :: [Type] Source # flattenParameters :: GRUCell inputDim hiddenDim dtype device -> HList (Parameters (GRUCell inputDim hiddenDim dtype device)) Source # replaceParameters :: GRUCell inputDim hiddenDim dtype device -> HList (Parameters (GRUCell inputDim hiddenDim dtype device)) -> GRUCell inputDim hiddenDim dtype device Source # | |
(KnownDevice device, KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, RandDTypeIsValid device dtype) => Randomizable (GRUCellSpec inputDim hiddenDim dtype device) (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU | |
type Rep (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU type Rep (GRUCell inputDim hiddenDim dtype device) = D1 ('MetaData "GRUCell" "Torch.Typed.NN.Recurrent.Cell.GRU" "hasktorch-0.2.0.0-F6yFRaDiRF49lpq95SVuR8" 'False) (C1 ('MetaCons "GRUCell" 'PrefixI 'True) ((S1 ('MetaSel ('Just "gruCell_w_ih") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[3 * hiddenDim, inputDim])) :*: S1 ('MetaSel ('Just "gruCell_w_hh") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[3 * hiddenDim, hiddenDim]))) :*: (S1 ('MetaSel ('Just "gruCell_b_ih") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[3 * hiddenDim])) :*: S1 ('MetaSel ('Just "gruCell_b_hh") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[3 * hiddenDim]))))) | |
type Parameters (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU type Parameters (GRUCell inputDim hiddenDim dtype device) = GParameters (Rep (GRUCell inputDim hiddenDim dtype device)) |
:: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) | |
=> GRUCell inputDim hiddenDim dtype device | The cell |
-> Tensor device dtype '[batchSize, hiddenDim] | The current Hidden state |
-> Tensor device dtype '[batchSize, inputDim] | The input |
-> Tensor device dtype '[batchSize, hiddenDim] | The subsequent Hidden state |
A single recurrent step of a GRUCell
:: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) | |
=> GRUCell inputDim hiddenDim dtype device | |
-> Tensor device dtype '[batchSize, hiddenDim] | The initial Hidden state |
-> [Tensor device dtype '[batchSize, inputDim]] | The list of inputs |
-> Tensor device dtype '[batchSize, hiddenDim] | The final Hidden state |
foldl' for lists of tensors unsing a GRUCell
:: forall inputDim hiddenDim batchSize dtype device. (KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, KnownNat batchSize) | |
=> GRUCell inputDim hiddenDim dtype device | |
-> Tensor device dtype '[batchSize, hiddenDim] | The initial Hidden state |
-> [Tensor device dtype '[batchSize, inputDim]] | The list of inputs |
-> [Tensor device dtype '[batchSize, hiddenDim]] | All subsequent Hidden states |
scanl' for lists of tensors unsing a GRUCell