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

Torch.Typed.NN.Recurrent.Cell.GRU

Synopsis

Documentation

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

A specification for a gated recurrent unit (GRU) cell.

Constructors

GRUCellSpec

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

Instances

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

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

Methods

minBound :: GRUCellSpec inputDim hiddenDim dtype device Source #

maxBound :: GRUCellSpec inputDim hiddenDim dtype device Source #

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

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

Methods

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 # 
Instance details

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

Associated Types

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

Methods

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 # 
Instance details

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

Methods

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

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

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

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

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

Methods

(==) :: 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 # 
Instance details

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

Methods

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 # 
Instance details

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

Methods

sample :: GRUCellSpec inputDim hiddenDim dtype device -> IO (GRUCell inputDim hiddenDim dtype device) Source #

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

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

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

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

A gated recurrent unit (GRU) cell.

Constructors

GRUCell 

Fields

Instances

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

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

Associated Types

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

Methods

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

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

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

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

Methods

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

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

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

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

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

Associated Types

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

Methods

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 # 
Instance details

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

Methods

sample :: GRUCellSpec inputDim hiddenDim dtype device -> IO (GRUCell inputDim hiddenDim dtype device) Source #

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

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 # 
Instance details

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

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

gruCellForward Source #

Arguments

:: 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

gruFold Source #

Arguments

:: 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

gruCellScan Source #

Arguments

:: 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