Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data LSTMLayerSpec (inputSize :: Nat) (hiddenSize :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) = LSTMLayerSpec
- data LSTMLayer (inputSize :: Nat) (hiddenSize :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) where
- LSTMUnidirectionalLayer :: Parameter device dtype (LSTMWIShape hiddenSize inputSize) -> Parameter device dtype (LSTMWHShape hiddenSize inputSize) -> Parameter device dtype (LSTMBIShape hiddenSize inputSize) -> Parameter device dtype (LSTMBHShape hiddenSize inputSize) -> LSTMLayer inputSize hiddenSize 'Unidirectional dtype device
- LSTMBidirectionalLayer :: Parameter device dtype (LSTMWIShape hiddenSize inputSize) -> Parameter device dtype (LSTMWHShape hiddenSize inputSize) -> Parameter device dtype (LSTMBIShape hiddenSize inputSize) -> Parameter device dtype (LSTMBHShape hiddenSize inputSize) -> Parameter device dtype (LSTMWIShape hiddenSize inputSize) -> Parameter device dtype (LSTMWHShape hiddenSize inputSize) -> Parameter device dtype (LSTMBIShape hiddenSize inputSize) -> Parameter device dtype (LSTMBHShape hiddenSize inputSize) -> LSTMLayer inputSize hiddenSize 'Bidirectional dtype device
- data LSTMLayerStackSpec (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) = LSTMLayerStackSpec
- data LSTMLayerStack (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) where
- LSTMLayer1 :: LSTMLayer inputSize hiddenSize directionality dtype device -> LSTMLayerStack inputSize hiddenSize 1 directionality dtype device
- LSTMLayerK :: LSTMLayer (hiddenSize * NumberOfDirections directionality) hiddenSize directionality dtype device -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> LSTMLayerStack inputSize hiddenSize (numLayers + 1) directionality dtype device
- class LSTMLayerStackParameterized (flag :: Bool) inputSize hiddenSize numLayers directionality dtype device where
- type LSTMLayerStackParameters flag inputSize hiddenSize numLayers directionality dtype device :: [Type]
- lstmLayerStackFlattenParameters :: Proxy flag -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (LSTMLayerStackParameters flag inputSize hiddenSize numLayers directionality dtype device)
- lstmLayerStackReplaceParameters :: Proxy flag -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (LSTMLayerStackParameters flag inputSize hiddenSize numLayers directionality dtype device) -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device
- class LSTMLayerStackRandomizable (flag :: Bool) inputSize hiddenSize numLayers directionality dtype device where
- lstmLayerStackSample :: Proxy flag -> LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> IO (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device)
- newtype LSTMSpec (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) = LSTMSpec DropoutSpec
- data LSTM (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) where
- xavierUniformLSTM :: forall device dtype hiddenSize featureSize. (KnownDType dtype, KnownNat hiddenSize, KnownNat featureSize, KnownDevice device, RandDTypeIsValid device dtype) => IO (Tensor device dtype '[4 * hiddenSize, featureSize])
- data LSTMWithInitSpec (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (initialization :: RNNInitialization) (dtype :: DType) (device :: (DeviceType, Nat)) where
- LSTMWithZerosInitSpec :: forall inputSize hiddenSize numLayers directionality dtype device. LSTMSpec inputSize hiddenSize numLayers directionality dtype device -> LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device
- LSTMWithConstInitSpec :: forall inputSize hiddenSize numLayers directionality dtype device. LSTMSpec inputSize hiddenSize numLayers directionality dtype device -> Tensor device dtype '[numLayers * NumberOfDirections directionality, hiddenSize] -> Tensor device dtype '[numLayers * NumberOfDirections directionality, hiddenSize] -> LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device
- LSTMWithLearnedInitSpec :: forall inputSize hiddenSize numLayers directionality dtype device. LSTMSpec inputSize hiddenSize numLayers directionality dtype device -> Tensor device dtype '[numLayers * NumberOfDirections directionality, hiddenSize] -> Tensor device dtype '[numLayers * NumberOfDirections directionality, hiddenSize] -> LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device
- data LSTMWithInit (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (initialization :: RNNInitialization) (dtype :: DType) (device :: (DeviceType, Nat)) where
- LSTMWithConstInit :: forall inputSize hiddenSize numLayers directionality dtype device. {..} -> LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device
- LSTMWithLearnedInit :: forall inputSize hiddenSize numLayers directionality dtype device. {..} -> LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device
- lstmForward :: forall shapeOrder batchSize seqLen directionality initialization numLayers inputSize outputSize hiddenSize inputShape outputShape hxShape parameters tensorParameters dtype device. (KnownNat (NumberOfDirections directionality), KnownNat numLayers, KnownNat batchSize, KnownNat hiddenSize, KnownRNNShapeOrder shapeOrder, KnownRNNDirectionality directionality, outputSize ~ (hiddenSize * NumberOfDirections directionality), inputShape ~ RNNShape shapeOrder seqLen batchSize inputSize, outputShape ~ RNNShape shapeOrder seqLen batchSize outputSize, hxShape ~ '[numLayers * NumberOfDirections directionality, batchSize, hiddenSize], parameters ~ Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device), Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), tensorParameters ~ LSTMR inputSize hiddenSize numLayers directionality dtype device, Castable (HList tensorParameters) [ATenTensor], HMap' ToDependent parameters tensorParameters) => Bool -> LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> Tensor device dtype inputShape -> (Tensor device dtype outputShape, Tensor device dtype hxShape, Tensor device dtype hxShape)
- lstmForwardWithDropout :: forall shapeOrder batchSize seqLen directionality initialization numLayers inputSize outputSize hiddenSize inputShape outputShape hxShape parameters tensorParameters dtype device. (KnownNat (NumberOfDirections directionality), KnownNat numLayers, KnownNat batchSize, KnownNat hiddenSize, KnownRNNShapeOrder shapeOrder, KnownRNNDirectionality directionality, outputSize ~ (hiddenSize * NumberOfDirections directionality), inputShape ~ RNNShape shapeOrder seqLen batchSize inputSize, outputShape ~ RNNShape shapeOrder seqLen batchSize outputSize, hxShape ~ '[numLayers * NumberOfDirections directionality, batchSize, hiddenSize], parameters ~ Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device), Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), tensorParameters ~ LSTMR inputSize hiddenSize numLayers directionality dtype device, Castable (HList tensorParameters) [ATenTensor], HMap' ToDependent parameters tensorParameters) => LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> Tensor device dtype inputShape -> (Tensor device dtype outputShape, Tensor device dtype hxShape, Tensor device dtype hxShape)
- lstmForwardWithoutDropout :: forall shapeOrder batchSize seqLen directionality initialization numLayers inputSize outputSize hiddenSize inputShape outputShape hxShape parameters tensorParameters dtype device. (KnownNat (NumberOfDirections directionality), KnownNat numLayers, KnownNat batchSize, KnownNat hiddenSize, KnownRNNShapeOrder shapeOrder, KnownRNNDirectionality directionality, outputSize ~ (hiddenSize * NumberOfDirections directionality), inputShape ~ RNNShape shapeOrder seqLen batchSize inputSize, outputShape ~ RNNShape shapeOrder seqLen batchSize outputSize, hxShape ~ '[numLayers * NumberOfDirections directionality, batchSize, hiddenSize], parameters ~ Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device), Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), tensorParameters ~ LSTMR inputSize hiddenSize numLayers directionality dtype device, Castable (HList tensorParameters) [ATenTensor], HMap' ToDependent parameters tensorParameters) => LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> Tensor device dtype inputShape -> (Tensor device dtype outputShape, Tensor device dtype hxShape, Tensor device dtype hxShape)
Documentation
data LSTMLayerSpec (inputSize :: Nat) (hiddenSize :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) Source #
Instances
Show (LSTMLayerSpec inputSize hiddenSize directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM | |
Eq (LSTMLayerSpec inputSize hiddenSize directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM (==) :: LSTMLayerSpec inputSize hiddenSize directionality dtype device -> LSTMLayerSpec inputSize hiddenSize directionality dtype device -> Bool Source # (/=) :: LSTMLayerSpec inputSize hiddenSize directionality dtype device -> LSTMLayerSpec inputSize hiddenSize directionality dtype device -> Bool Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (LSTMLayerSpec inputSize hiddenSize 'Bidirectional dtype device) (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMLayerSpec inputSize hiddenSize 'Bidirectional dtype device -> IO (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (LSTMLayerSpec inputSize hiddenSize 'Unidirectional dtype device) (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMLayerSpec inputSize hiddenSize 'Unidirectional dtype device -> IO (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # |
data LSTMLayer (inputSize :: Nat) (hiddenSize :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) where Source #
LSTMUnidirectionalLayer :: Parameter device dtype (LSTMWIShape hiddenSize inputSize) -> Parameter device dtype (LSTMWHShape hiddenSize inputSize) -> Parameter device dtype (LSTMBIShape hiddenSize inputSize) -> Parameter device dtype (LSTMBHShape hiddenSize inputSize) -> LSTMLayer inputSize hiddenSize 'Unidirectional dtype device | |
LSTMBidirectionalLayer :: Parameter device dtype (LSTMWIShape hiddenSize inputSize) -> Parameter device dtype (LSTMWHShape hiddenSize inputSize) -> Parameter device dtype (LSTMBIShape hiddenSize inputSize) -> Parameter device dtype (LSTMBHShape hiddenSize inputSize) -> Parameter device dtype (LSTMWIShape hiddenSize inputSize) -> Parameter device dtype (LSTMWHShape hiddenSize inputSize) -> Parameter device dtype (LSTMBIShape hiddenSize inputSize) -> Parameter device dtype (LSTMBHShape hiddenSize inputSize) -> LSTMLayer inputSize hiddenSize 'Bidirectional dtype device |
Instances
Show (LSTMLayer inputSize hiddenSize directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM | |
Parameterized (LSTMLayer inputSize hiddenSize directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM flattenParameters :: LSTMLayer inputSize hiddenSize directionality dtype device -> [Parameter] Source # _replaceParameters :: LSTMLayer inputSize hiddenSize directionality dtype device -> ParamStream (LSTMLayer inputSize hiddenSize directionality dtype device) Source # | |
Parameterized (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) :: [Type] Source # flattenParameters :: LSTMLayer inputSize hiddenSize 'Bidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device)) Source # replaceParameters :: LSTMLayer inputSize hiddenSize 'Bidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device)) -> LSTMLayer inputSize hiddenSize 'Bidirectional dtype device Source # | |
Parameterized (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) :: [Type] Source # flattenParameters :: LSTMLayer inputSize hiddenSize 'Unidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device)) Source # replaceParameters :: LSTMLayer inputSize hiddenSize 'Unidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device)) -> LSTMLayer inputSize hiddenSize 'Unidirectional dtype device Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (LSTMLayerSpec inputSize hiddenSize 'Bidirectional dtype device) (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMLayerSpec inputSize hiddenSize 'Bidirectional dtype device -> IO (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (LSTMLayerSpec inputSize hiddenSize 'Unidirectional dtype device) (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMLayerSpec inputSize hiddenSize 'Unidirectional dtype device -> IO (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
type Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) = '[Parameter device dtype (LSTMWIShape hiddenSize inputSize), Parameter device dtype (LSTMWHShape hiddenSize inputSize), Parameter device dtype (LSTMBIShape hiddenSize inputSize), Parameter device dtype (LSTMBHShape hiddenSize inputSize), Parameter device dtype (LSTMWIShape hiddenSize inputSize), Parameter device dtype (LSTMWHShape hiddenSize inputSize), Parameter device dtype (LSTMBIShape hiddenSize inputSize), Parameter device dtype (LSTMBHShape hiddenSize inputSize)] | |
type Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) = '[Parameter device dtype (LSTMWIShape hiddenSize inputSize), Parameter device dtype (LSTMWHShape hiddenSize inputSize), Parameter device dtype (LSTMBIShape hiddenSize inputSize), Parameter device dtype (LSTMBHShape hiddenSize inputSize)] |
data LSTMLayerStackSpec (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) Source #
Instances
Show (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM showsPrec :: Int -> LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> ShowS Source # show :: LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> String Source # showList :: [LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device] -> ShowS Source # | |
Eq (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM (==) :: LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> Bool Source # (/=) :: LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> Bool Source # | |
(1 <= numLayers, (2 <=? numLayers) ~ flag, RandDTypeIsValid device dtype, KnownDType dtype, KnownDevice device, LSTMLayerStackRandomizable flag inputSize hiddenSize numLayers directionality dtype device) => Randomizable (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> IO (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # |
data LSTMLayerStack (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) where Source #
LSTMLayer1 :: LSTMLayer inputSize hiddenSize directionality dtype device -> LSTMLayerStack inputSize hiddenSize 1 directionality dtype device | |
LSTMLayerK :: LSTMLayer (hiddenSize * NumberOfDirections directionality) hiddenSize directionality dtype device -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> LSTMLayerStack inputSize hiddenSize (numLayers + 1) directionality dtype device |
Instances
Show (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM showsPrec :: Int -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> ShowS Source # show :: LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> String Source # showList :: [LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device] -> ShowS Source # | |
Parameterized (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM flattenParameters :: LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> [Parameter] Source # _replaceParameters :: LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> ParamStream (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
(1 <= numLayers, (2 <=? numLayers) ~ flag, LSTMLayerStackParameterized flag inputSize hiddenSize numLayers directionality dtype device) => Parameterized (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) :: [Type] Source # flattenParameters :: LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device)) Source # replaceParameters :: LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device)) -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device Source # | |
(1 <= numLayers, (2 <=? numLayers) ~ flag, RandDTypeIsValid device dtype, KnownDType dtype, KnownDevice device, LSTMLayerStackRandomizable flag inputSize hiddenSize numLayers directionality dtype device) => Randomizable (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> IO (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
type Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) = LSTMLayerStackParameters (2 <=? numLayers) inputSize hiddenSize numLayers directionality dtype device |
class LSTMLayerStackParameterized (flag :: Bool) inputSize hiddenSize numLayers directionality dtype device where Source #
type LSTMLayerStackParameters flag inputSize hiddenSize numLayers directionality dtype device :: [Type] Source #
lstmLayerStackFlattenParameters :: Proxy flag -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (LSTMLayerStackParameters flag inputSize hiddenSize numLayers directionality dtype device) Source #
lstmLayerStackReplaceParameters :: Proxy flag -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (LSTMLayerStackParameters flag inputSize hiddenSize numLayers directionality dtype device) -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device Source #
Instances
Parameterized (LSTMLayer inputSize hiddenSize directionality dtype device) => LSTMLayerStackParameterized 'False inputSize hiddenSize 1 directionality dtype device Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type LSTMLayerStackParameters 'False inputSize hiddenSize 1 directionality dtype device :: [Type] Source # lstmLayerStackFlattenParameters :: Proxy 'False -> LSTMLayerStack inputSize hiddenSize 1 directionality dtype device -> HList (LSTMLayerStackParameters 'False inputSize hiddenSize 1 directionality dtype device) Source # lstmLayerStackReplaceParameters :: Proxy 'False -> LSTMLayerStack inputSize hiddenSize 1 directionality dtype device -> HList (LSTMLayerStackParameters 'False inputSize hiddenSize 1 directionality dtype device) -> LSTMLayerStack inputSize hiddenSize 1 directionality dtype device Source # | |
(Parameterized (LSTMLayer (hiddenSize * NumberOfDirections directionality) hiddenSize directionality dtype device), Parameterized (LSTMLayerStack inputSize hiddenSize (numLayers - 1) directionality dtype device), HAppendFD (Parameters (LSTMLayerStack inputSize hiddenSize (numLayers - 1) directionality dtype device)) (Parameters (LSTMLayer (hiddenSize * NumberOfDirections directionality) hiddenSize directionality dtype device)) (Parameters (LSTMLayerStack inputSize hiddenSize (numLayers - 1) directionality dtype device) ++ Parameters (LSTMLayer (hiddenSize * NumberOfDirections directionality) hiddenSize directionality dtype device))) => LSTMLayerStackParameterized 'True inputSize hiddenSize numLayers directionality dtype device Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type LSTMLayerStackParameters 'True inputSize hiddenSize numLayers directionality dtype device :: [Type] Source # lstmLayerStackFlattenParameters :: Proxy 'True -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (LSTMLayerStackParameters 'True inputSize hiddenSize numLayers directionality dtype device) Source # lstmLayerStackReplaceParameters :: Proxy 'True -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (LSTMLayerStackParameters 'True inputSize hiddenSize numLayers directionality dtype device) -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device Source # |
class LSTMLayerStackRandomizable (flag :: Bool) inputSize hiddenSize numLayers directionality dtype device where Source #
lstmLayerStackSample :: Proxy flag -> LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> IO (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source #
Instances
Randomizable (LSTMLayerSpec inputSize hiddenSize directionality dtype device) (LSTMLayer inputSize hiddenSize directionality dtype device) => LSTMLayerStackRandomizable 'False inputSize hiddenSize 1 directionality dtype device Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM lstmLayerStackSample :: Proxy 'False -> LSTMLayerStackSpec inputSize hiddenSize 1 directionality dtype device -> IO (LSTMLayerStack inputSize hiddenSize 1 directionality dtype device) Source # | |
(1 <= numLayers, Randomizable (LSTMLayerSpec (hiddenSize * NumberOfDirections directionality) hiddenSize directionality dtype device) (LSTMLayer (hiddenSize * NumberOfDirections directionality) hiddenSize directionality dtype device), Randomizable (LSTMLayerStackSpec inputSize hiddenSize (numLayers - 1) directionality dtype device) (LSTMLayerStack inputSize hiddenSize (numLayers - 1) directionality dtype device)) => LSTMLayerStackRandomizable 'True inputSize hiddenSize numLayers directionality dtype device Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM lstmLayerStackSample :: Proxy 'True -> LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> IO (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # |
newtype LSTMSpec (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) Source #
Instances
Generic (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Rep (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) :: Type -> Type Source # from :: LSTMSpec inputSize hiddenSize numLayers directionality dtype device -> Rep (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) x Source # to :: Rep (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) x -> LSTMSpec inputSize hiddenSize numLayers directionality dtype device Source # | |
Show (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM | |
(KnownDType dtype, KnownDevice device, KnownNat inputSize, KnownNat hiddenSize, KnownNat (NumberOfDirections directionality), RandDTypeIsValid device dtype, Randomizable (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device), 1 <= numLayers) => Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
type Rep (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Rep (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) = D1 ('MetaData "LSTMSpec" "Torch.Typed.NN.Recurrent.LSTM" "hasktorch-0.2.0.0-F6yFRaDiRF49lpq95SVuR8" 'True) (C1 ('MetaCons "LSTMSpec" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DropoutSpec))) |
data LSTM (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (dtype :: DType) (device :: (DeviceType, Nat)) where Source #
LSTM | |
|
Instances
1 <= numLayers => Generic (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM from :: LSTM inputSize hiddenSize numLayers directionality dtype device -> Rep (LSTM inputSize hiddenSize numLayers directionality dtype device) x Source # to :: Rep (LSTM inputSize hiddenSize numLayers directionality dtype device) x -> LSTM inputSize hiddenSize numLayers directionality dtype device Source # | |
Show (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM | |
Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM flattenParameters :: LSTM inputSize hiddenSize numLayers directionality dtype device -> [Parameter] Source # _replaceParameters :: LSTM inputSize hiddenSize numLayers directionality dtype device -> ParamStream (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
(1 <= numLayers, Parameterized (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device)) (Parameters Dropout) (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) ++ Parameters Dropout)) => Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) :: [Type] Source # flattenParameters :: LSTM inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) Source # replaceParameters :: LSTM inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) -> LSTM inputSize hiddenSize numLayers directionality dtype device Source # | |
(KnownDType dtype, KnownDevice device, KnownNat inputSize, KnownNat hiddenSize, KnownNat (NumberOfDirections directionality), RandDTypeIsValid device dtype, Randomizable (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device), 1 <= numLayers) => Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
type Rep (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM | |
type Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) = GParameters (Rep (LSTM inputSize hiddenSize numLayers directionality dtype device)) |
xavierUniformLSTM :: forall device dtype hiddenSize featureSize. (KnownDType dtype, KnownNat hiddenSize, KnownNat featureSize, KnownDevice device, RandDTypeIsValid device dtype) => IO (Tensor device dtype '[4 * hiddenSize, featureSize]) Source #
Helper to do xavier uniform initializations on weight matrices and orthagonal initializations for the gates. (When implemented.)
data LSTMWithInitSpec (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (initialization :: RNNInitialization) (dtype :: DType) (device :: (DeviceType, Nat)) where Source #
A specification for a long, short-term memory layer.
LSTMWithZerosInitSpec :: forall inputSize hiddenSize numLayers directionality dtype device. LSTMSpec inputSize hiddenSize numLayers directionality dtype device -> LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device | Weights drawn from Xavier-Uniform with zeros-value initialized biases and cell states. |
LSTMWithConstInitSpec | Weights drawn from Xavier-Uniform with zeros-value initialized biases and user-provided cell states. |
| |
LSTMWithLearnedInitSpec | Weights drawn from Xavier-Uniform with zeros-value initialized biases and learned cell states. |
|
Instances
Show (LSTMWithInitSpec inputSize hiddenSize numLayers directionality initialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM showsPrec :: Int -> LSTMWithInitSpec inputSize hiddenSize numLayers directionality initialization dtype device -> ShowS Source # show :: LSTMWithInitSpec inputSize hiddenSize numLayers directionality initialization dtype device -> String Source # showList :: [LSTMWithInitSpec inputSize hiddenSize numLayers directionality initialization dtype device] -> ShowS Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> IO (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> IO (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # |
data LSTMWithInit (inputSize :: Nat) (hiddenSize :: Nat) (numLayers :: Nat) (directionality :: RNNDirectionality) (initialization :: RNNInitialization) (dtype :: DType) (device :: (DeviceType, Nat)) where Source #
A long, short-term memory layer with either fixed initial states for the memory cells and hidden state or learnable inital states for the memory cells and hidden state.
LSTMWithConstInit | |
| |
LSTMWithLearnedInit | |
|
Instances
Generic (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) :: Type -> Type Source # from :: LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) x Source # to :: Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) x -> LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device Source # | |
Generic (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) :: Type -> Type Source # from :: LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) x Source # to :: Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) x -> LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device Source # | |
Show (LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM showsPrec :: Int -> LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> ShowS Source # show :: LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> String Source # showList :: [LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device] -> ShowS Source # | |
Parameterized (LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM flattenParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> [Parameter] Source # _replaceParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> ParamStream (LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device) Source # | |
(Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) ('[] :: [Type]) (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) ++ ('[] :: [Type]))) => Parameterized (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) :: [Type] Source # flattenParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) Source # replaceParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) -> LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device Source # | |
(Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) '[Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize], Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]] (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) ++ '[Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize], Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]])) => Parameterized (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) :: [Type] Source # flattenParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) Source # replaceParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) -> LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> IO (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM sample :: LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> IO (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
type Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) = Rec0 (LSTM inputSize hiddenSize numLayers directionality dtype device) :*: (Rec0 (Tensor device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]) :*: Rec0 (Tensor device dtype '[numLayers * NumberOfDirections directionality, hiddenSize])) | |
type Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) = Rec0 (LSTM inputSize hiddenSize numLayers directionality dtype device) :*: (Rec0 (Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]) :*: Rec0 (Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize])) | |
type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) = GParameters (Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) | |
type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) = GParameters (Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) |
lstmForward :: forall shapeOrder batchSize seqLen directionality initialization numLayers inputSize outputSize hiddenSize inputShape outputShape hxShape parameters tensorParameters dtype device. (KnownNat (NumberOfDirections directionality), KnownNat numLayers, KnownNat batchSize, KnownNat hiddenSize, KnownRNNShapeOrder shapeOrder, KnownRNNDirectionality directionality, outputSize ~ (hiddenSize * NumberOfDirections directionality), inputShape ~ RNNShape shapeOrder seqLen batchSize inputSize, outputShape ~ RNNShape shapeOrder seqLen batchSize outputSize, hxShape ~ '[numLayers * NumberOfDirections directionality, batchSize, hiddenSize], parameters ~ Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device), Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), tensorParameters ~ LSTMR inputSize hiddenSize numLayers directionality dtype device, Castable (HList tensorParameters) [ATenTensor], HMap' ToDependent parameters tensorParameters) => Bool -> LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> Tensor device dtype inputShape -> (Tensor device dtype outputShape, Tensor device dtype hxShape, Tensor device dtype hxShape) Source #
lstmForwardWithDropout :: forall shapeOrder batchSize seqLen directionality initialization numLayers inputSize outputSize hiddenSize inputShape outputShape hxShape parameters tensorParameters dtype device. (KnownNat (NumberOfDirections directionality), KnownNat numLayers, KnownNat batchSize, KnownNat hiddenSize, KnownRNNShapeOrder shapeOrder, KnownRNNDirectionality directionality, outputSize ~ (hiddenSize * NumberOfDirections directionality), inputShape ~ RNNShape shapeOrder seqLen batchSize inputSize, outputShape ~ RNNShape shapeOrder seqLen batchSize outputSize, hxShape ~ '[numLayers * NumberOfDirections directionality, batchSize, hiddenSize], parameters ~ Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device), Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), tensorParameters ~ LSTMR inputSize hiddenSize numLayers directionality dtype device, Castable (HList tensorParameters) [ATenTensor], HMap' ToDependent parameters tensorParameters) => LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> Tensor device dtype inputShape -> (Tensor device dtype outputShape, Tensor device dtype hxShape, Tensor device dtype hxShape) Source #
Forward propagate the LSTM
module (without applying dropout on the outputs of each layer).
>>>
input :: CPUTensor 'D.Float '[5,16,10] <- randn
>>>
spec = LSTMWithZerosInitSpec @10 @30 @3 @'Bidirectional @'D.Float @'( 'D.CPU, 0) (LSTMSpec (DropoutSpec 0.5))
>>>
model <- A.sample spec
>>>
:t lstmForwardWithoutDropout @'BatchFirst model input
lstmForwardWithoutDropout @'BatchFirst model input :: (Tensor '( 'D.CPU, 0) 'D.Float '[5, 16, 60], Tensor '( 'D.CPU, 0) 'D.Float '[6, 5, 30], Tensor '( 'D.CPU, 0) 'D.Float '[6, 5, 30])>>>
(a,b,c) = lstmForwardWithoutDropout @'BatchFirst model input
>>>
((dtype a, shape a), (dtype b, shape b), (dtype c, shape c))
((Float,[5,16,60]),(Float,[6,5,30]),(Float,[6,5,30]))
Forward propagate the LSTM
module and apply dropout on the outputs of each layer.
>>>
input :: CPUTensor 'D.Float '[5,16,10] <- randn
>>>
spec = LSTMWithZerosInitSpec @10 @30 @3 @'Bidirectional @'D.Float @'( 'D.CPU, 0) (LSTMSpec (DropoutSpec 0.5))
>>>
model <- A.sample spec
>>>
:t lstmForwardWithDropout @'BatchFirst model input
lstmForwardWithDropout @'BatchFirst model input :: (Tensor '( 'D.CPU, 0) 'D.Float '[5, 16, 60], Tensor '( 'D.CPU, 0) 'D.Float '[6, 5, 30], Tensor '( 'D.CPU, 0) 'D.Float '[6, 5, 30])>>>
(a,b,c) = lstmForwardWithDropout @'BatchFirst model input
>>>
((dtype a, shape a), (dtype b, shape b), (dtype c, shape c))
((Float,[5,16,60]),(Float,[6,5,30]),(Float,[6,5,30]))
lstmForwardWithoutDropout :: forall shapeOrder batchSize seqLen directionality initialization numLayers inputSize outputSize hiddenSize inputShape outputShape hxShape parameters tensorParameters dtype device. (KnownNat (NumberOfDirections directionality), KnownNat numLayers, KnownNat batchSize, KnownNat hiddenSize, KnownRNNShapeOrder shapeOrder, KnownRNNDirectionality directionality, outputSize ~ (hiddenSize * NumberOfDirections directionality), inputShape ~ RNNShape shapeOrder seqLen batchSize inputSize, outputShape ~ RNNShape shapeOrder seqLen batchSize outputSize, hxShape ~ '[numLayers * NumberOfDirections directionality, batchSize, hiddenSize], parameters ~ Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device), Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), tensorParameters ~ LSTMR inputSize hiddenSize numLayers directionality dtype device, Castable (HList tensorParameters) [ATenTensor], HMap' ToDependent parameters tensorParameters) => LSTMWithInit inputSize hiddenSize numLayers directionality initialization dtype device -> Tensor device dtype inputShape -> (Tensor device dtype outputShape, Tensor device dtype hxShape, Tensor device dtype hxShape) Source #
Forward propagate the LSTM
module and apply dropout on the outputs of each layer.
>>>
input :: CPUTensor 'D.Float '[5,16,10] <- randn
>>>
spec = LSTMWithZerosInitSpec @10 @30 @3 @'Bidirectional @'D.Float @'( 'D.CPU, 0) (LSTMSpec (DropoutSpec 0.5))
>>>
model <- A.sample spec
>>>
:t lstmForwardWithDropout @'BatchFirst model input
lstmForwardWithDropout @'BatchFirst model input :: (Tensor '( 'D.CPU, 0) 'D.Float '[5, 16, 60], Tensor '( 'D.CPU, 0) 'D.Float '[6, 5, 30], Tensor '( 'D.CPU, 0) 'D.Float '[6, 5, 30])>>>
(a,b,c) = lstmForwardWithDropout @'BatchFirst model input
>>>
((dtype a, shape a), (dtype b, shape b), (dtype c, shape c))
((Float,[5,16,60]),(Float,[6,5,30]),(Float,[6,5,30]))