Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data EncoderDecoderTransformerHasEmbedScaling
- data GEncoderDecoderTransformer (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (encoder :: Type) (decoder :: Type) (sharedEmbedding :: Type) (head :: Type) where
- GEncoderDecoderTransformer :: forall inputEmbedDim encoder decoder sharedEmbedding head. {..} -> GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head
- type family GEncoderDecoderTransformerF (style :: TransformerStyle) (transformerHead :: TransformerHead) (numEncoderLayers :: Nat) (numDecoderLayers :: Nat) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (headDim :: Dim (Name Symbol) (Size Nat)) (headEmbedDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (ffnDim :: Dim (Name Symbol) (Size Nat)) (posEncDim :: Dim (Name Symbol) (Size Nat)) (vocabDim :: Dim (Name Symbol) (Size Nat)) (hasDropout :: HasDropout) :: Type where ...
- type family EDTEncoderF (style :: TransformerStyle) (numEncoderLayers :: Nat) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (headDim :: Dim (Name Symbol) (Size Nat)) (headEmbedDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (ffnDim :: Dim (Name Symbol) (Size Nat)) (posEncDim :: Dim (Name Symbol) (Size Nat)) (hasDropout :: HasDropout) :: Type where ...
- type family EDTDecoderF (style :: TransformerStyle) (numDecoderLayers :: Nat) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (headDim :: Dim (Name Symbol) (Size Nat)) (headEmbedDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (ffnDim :: Dim (Name Symbol) (Size Nat)) (posEncDim :: Dim (Name Symbol) (Size Nat)) (hasDropout :: HasDropout) :: Type where ...
- type family EDTSharedEmbeddingF (style :: TransformerStyle) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (vocabDim :: Dim (Name Symbol) (Size Nat)) where ...
- type family EDTHeadF (style :: TransformerStyle) (transformerHead :: TransformerHead) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (vocabDim :: Dim (Name Symbol) (Size Nat)) :: Type where ...
- encoderDecoderTransformerSpec :: forall style transformerHead numEncoderLayers numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim vocabDim hasDropout. STransformerStyle style -> STransformerHead transformerHead -> SNat numEncoderLayers -> SNat numDecoderLayers -> SGradient gradient -> SDevice device -> SDataType dataType -> SDim headDim -> SDim headEmbedDim -> SDim embedDim -> SDim inputEmbedDim -> SDim ffnDim -> SDim posEncDim -> SDim vocabDim -> SHasDropout hasDropout -> Double -> Double -> ModelSpec (GEncoderDecoderTransformerF style transformerHead numEncoderLayers numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim vocabDim hasDropout)
- data GSimplifiedEncoderDecoderTransformer (model :: Type) (mkPos :: Type) (mkDecoderPos :: Type) (mkPaddingMask :: Type) (mkAttentionMask :: Type) (mkCrossAttentionMask :: Type) (mkDecoderAttentionMask :: Type) where
- GSimplifiedEncoderDecoderTransformer :: forall model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask. {..} -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask
- data EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask where
- EncoderDecoderTransformerInput :: forall input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask. {..} -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask
- data EncoderDecoderTransformerInput' input pos attentionMask where
- EncoderDecoderTransformerInput' :: forall input pos attentionMask. {..} -> EncoderDecoderTransformerInput' input pos attentionMask
- data SimplifiedEncoderDecoderTransformerInput input decoderInput where
- SimplifiedEncoderDecoderTransformerInput :: forall input decoderInput. {..} -> SimplifiedEncoderDecoderTransformerInput input decoderInput
- data SimplifiedEncoderDecoderTransformerInput' input where
- SimplifiedEncoderDecoderTransformerInput' :: forall input. {..} -> SimplifiedEncoderDecoderTransformerInput' input
- data SimplifiedEncoderDecoderTransformerTrainingInput input target where
- SimplifiedEncoderDecoderTransformerTrainingInput :: forall input target. {..} -> SimplifiedEncoderDecoderTransformerTrainingInput input target
- data EncoderDecoderTransformerOutput decoderOutput encoderOutput where
- EncoderDecoderTransformerOutput :: forall decoderOutput encoderOutput. {..} -> EncoderDecoderTransformerOutput decoderOutput encoderOutput
- data EncoderDecoderTransformerOutput' encoderOutput where
- EncoderDecoderTransformerOutput' :: forall encoderOutput. {..} -> EncoderDecoderTransformerOutput' encoderOutput
- data SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask where
- SimplifiedEncoderDecoderTransformerOutput :: forall decoderOutput encoderOutput decoderInput inputPaddingMask. {..} -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask
- data SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask where
- SimplifiedEncoderDecoderTransformerOutput' :: forall encoderOutput inputPaddingMask. {..} -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask
- data SimplifiedEncoderDecoderTransformerTrainingOutput loss where
- SimplifiedEncoderDecoderTransformerTrainingOutput :: forall loss. {..} -> SimplifiedEncoderDecoderTransformerTrainingOutput loss
- data EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask where
- EncoderDecoderTransformerGenerationInput :: forall decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask. {..} -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask
- data SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask where
- SimplifiedEncoderDecoderTransformerGenerationInput :: forall decoderInput encoderOutput inputPaddingMask. {..} -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask
Documentation
data EncoderDecoderTransformerHasEmbedScaling Source #
Data type that is used to represent whether the encoder-decoder transformer model has a scaled embedding.
Instances
data GEncoderDecoderTransformer (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (encoder :: Type) (decoder :: Type) (sharedEmbedding :: Type) (head :: Type) where Source #
Generic encoder-decoder transformer model. This is a model that can be used to encode and decode sequences of variable length.
inputEmbedDim
: the dimension of the input embedding.encoder
: a transformer encoder.decoder
: a transformer decoder.sharedEmbedding
: a shared embedding layer.head
: a head layer for the output.
GEncoderDecoderTransformer | |
|
Instances
Generic (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) :: Type -> Type Source # from :: GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> Rep (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) x Source # to :: Rep (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) x -> GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head Source # | |
(Show encoder, Show decoder, Show sharedEmbedding, Show head) => Show (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder showsPrec :: Int -> GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> ShowS Source # show :: GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> String Source # showList :: [GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head] -> ShowS Source # | |
(HasStateDict encoder, HasStateDict decoder, HasStateDict sharedEmbedding, HasStateDict head) => HasStateDict (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder fromStateDict :: (MonadIO m, MonadThrow m, MonadState StateDict m) => ModelSpec (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) -> StateDictKey -> m (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) Source # toStateDict :: (MonadThrow m, MonadState StateDict m) => StateDictKey -> GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> m () Source # | |
(HasInitialize encoder generatorDevice encoder' generatorDevice0, HasInitialize decoder generatorDevice0 decoder' generatorDevice1, HasInitialize sharedEmbedding generatorDevice1 sharedEmbedding' generatorDevice2, HasInitialize head generatorDevice2 head' generatorOutputDevice) => HasInitialize (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) generatorDevice (GEncoderDecoderTransformer inputEmbedDim encoder' decoder' sharedEmbedding' head') generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder initialize :: MonadThrow m => ModelSpec (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) -> Generator generatorDevice -> m (GEncoderDecoderTransformer inputEmbedDim encoder' decoder' sharedEmbedding' head', Generator generatorOutputDevice) Source # | |
(HasForward sharedEmbedding input generatorDevice embeddingOutput embeddingGeneratorOutputDevice, embeddingOutput ~ Tensor requiresGradient' layout' device' dataType' shape', HasForward encoder (embeddingOutput, pos, attentionMask) embeddingGeneratorOutputDevice encoderOutput generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput' input pos attentionMask) generatorDevice (EncoderDecoderTransformerOutput' encoderOutput) generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerInput' input pos attentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput' encoderOutput, Generator generatorOutputDevice) Source # | |
(HasForward sharedEmbedding decoderInput generatorDevice embeddingOutput' embeddingGeneratorOutputDevice', embeddingOutput' ~ Tensor requiresGradient'' layout'' device'' dataType'' shape'', HasForward decoder (embeddingOutput', encoderOutput, decoderPos, decoderAttentionMask, crossAttentionMask) embeddingGeneratorOutputDevice' decoderOutput decoderGeneratorOutputDevice, HasForward head decoderOutput decoderGeneratorOutputDevice headOutput generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice Source # |
┌───────────────┐ ┌──────────────┐ ┌────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │ encoderOutput │ │ decoderInput │ │ decoderPos │ │ decoderAttentionMask │ │ crossAttentionMask │ └───────┬───────┘ └───────┬──────┘ └──────┬─────┘ └───────────┬──────────┘ └──────────┬─────────┘ │ │ │ │ │ │ ▼ │ │ │ │ edtSharedEmbedding │ │ │ │ ▼ │ │ │ │ (embedScaling) │ │ │ │ ▼ │ │ │ ├────────────►edtDecoder◄───────────┘◄───────────────────┘◄───────────────────────┘ │ │ │ (edtHead) │ │ ▼ ▼ ┌───────────────┐ ┌───────────────┐ │ encoderOutput │ │ decoderOutput │ └───────────────┘ └───────────────┘ |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput headOutput encoderOutput, Generator generatorOutputDevice) Source # | |
(HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput' input pos attentionMask) generatorDevice (EncoderDecoderTransformerOutput' encoderOutput) generatorDevice', HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice' (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice Source # |
┌───────┐ ┌─────┐ ┌───────────────┐ ┌──────────────┐ ┌────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │ input │ │ pos │ │ attentionMask │ │ decoderInput │ │ decoderPos │ │ decoderAttentionMask │ │ crossAttentionMask │ └───┬───┘ └──┬──┘ └──────┬────────┘ └──────┬───────┘ └─────┬──────┘ └──────────┬───────────┘ └─────────┬──────────┘ │ │ │ │ │ │ │ ▼ │ │ │ │ │ │ edtSharedEmbedding│ │ │ │ │ │ ▼ │ │ │ │ │ │ (embedScaling) │ │ │ │ │ │ ▼ │ │ │ │ │ │ edtEncoder◄───┘◄───────────┘ ▼ │ │ │ │ edtSharedEmbedding │ │ │ │ ▼ │ │ │ │ (embedScaling) │ │ │ │ ▼ │ │ │ ├────────────────────────────────────►edtDecoder◄──────────┘◄───────────────────┘◄───────────────────────┘ │ ▼ │ (edtHead) │ │ ▼ ▼ ┌───────────────┐ ┌───────────────┐ │ encoderOutput │ │ decoderOutput │ └───────────────┘ └───────────────┘ |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput headOutput encoderOutput, Generator generatorOutputDevice) Source # | |
type Rep (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) = D1 ('MetaData "GEncoderDecoderTransformer" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "GEncoderDecoderTransformer" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edtInputEmbedDim") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SDim inputEmbedDim)) :*: (S1 ('MetaSel ('Just "edtEncoder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 encoder) :*: S1 ('MetaSel ('Just "edtDecoder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoder))) :*: (S1 ('MetaSel ('Just "edtSharedEmbedding") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 sharedEmbedding) :*: (S1 ('MetaSel ('Just "edtHead") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 head) :*: S1 ('MetaSel ('Just "edtEmbedScaling") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EncoderDecoderTransformerHasEmbedScaling))))) | |
type ModelSpec (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type ModelSpec (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) = GEncoderDecoderTransformer inputEmbedDim (ModelSpec encoder) (ModelSpec decoder) (ModelSpec sharedEmbedding) (ModelSpec head) |
type family GEncoderDecoderTransformerF (style :: TransformerStyle) (transformerHead :: TransformerHead) (numEncoderLayers :: Nat) (numDecoderLayers :: Nat) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (headDim :: Dim (Name Symbol) (Size Nat)) (headEmbedDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (ffnDim :: Dim (Name Symbol) (Size Nat)) (posEncDim :: Dim (Name Symbol) (Size Nat)) (vocabDim :: Dim (Name Symbol) (Size Nat)) (hasDropout :: HasDropout) :: Type where ... Source #
GEncoderDecoderTransformerF style transformerHead numEncoderLayers numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim vocabDim hasDropout = GEncoderDecoderTransformer inputEmbedDim (EDTEncoderF style numEncoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim hasDropout) (EDTDecoderF style numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim hasDropout) (EDTSharedEmbeddingF style gradient device dataType inputEmbedDim vocabDim) (EDTHeadF style transformerHead gradient device dataType inputEmbedDim vocabDim) |
type family EDTEncoderF (style :: TransformerStyle) (numEncoderLayers :: Nat) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (headDim :: Dim (Name Symbol) (Size Nat)) (headEmbedDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (ffnDim :: Dim (Name Symbol) (Size Nat)) (posEncDim :: Dim (Name Symbol) (Size Nat)) (hasDropout :: HasDropout) :: Type where ... Source #
Specifies the encoder of the encoder-decoder transformer model.
EDTEncoderF style numEncoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim hasDropout = NamedModel (TransformerEncoderF style numEncoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim hasDropout) |
type family EDTDecoderF (style :: TransformerStyle) (numDecoderLayers :: Nat) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (headDim :: Dim (Name Symbol) (Size Nat)) (headEmbedDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (ffnDim :: Dim (Name Symbol) (Size Nat)) (posEncDim :: Dim (Name Symbol) (Size Nat)) (hasDropout :: HasDropout) :: Type where ... Source #
Specifies the decoder of the encoder-decoder transformer model.
EDTDecoderF style numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim hasDropout = NamedModel (TransformerDecoderF style numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim inputEmbedDim ffnDim posEncDim hasDropout) |
type family EDTSharedEmbeddingF (style :: TransformerStyle) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (vocabDim :: Dim (Name Symbol) (Size Nat)) where ... Source #
Specifies the shared embedding layer of the encoder-decoder transformer model.
EDTSharedEmbeddingF _ gradient device dataType inputEmbedDim vocabDim = NamedModel (Embedding gradient ('Layout 'Dense) device dataType vocabDim inputEmbedDim 'Nothing) |
type family EDTHeadF (style :: TransformerStyle) (transformerHead :: TransformerHead) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputEmbedDim :: Dim (Name Symbol) (Size Nat)) (vocabDim :: Dim (Name Symbol) (Size Nat)) :: Type where ... Source #
Specifies the head of the encoder-decoder transformer model.
EDTHeadF style 'WithoutHead gradient device dataType inputEmbedDim vocabDim = () | |
EDTHeadF style 'WithLMHead gradient device dataType inputEmbedDim vocabDim = NamedModel (GLMHeadF style gradient device dataType inputEmbedDim vocabDim) |
encoderDecoderTransformerSpec Source #
:: forall style transformerHead numEncoderLayers numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim vocabDim hasDropout. STransformerStyle style | the style of the encoder-decoder transformer model, e.g. |
-> STransformerHead transformerHead | the head of the encoder-decoder transformer model. |
-> SNat numEncoderLayers | the number of encoder layers of the encoder-decoder transformer model. |
-> SNat numDecoderLayers | the number of decoder layers of the encoder-decoder transformer model. |
-> SGradient gradient | whether or not to compute the gradient of the model parameters |
-> SDevice device | the computational device on which the model is allocated. |
-> SDataType dataType | the data type of the model parameters. |
-> SDim headDim | the dimension of all transformer heads in the encoder-decoder transformer model. |
-> SDim headEmbedDim | the dimension of the transformer head embeddings. |
-> SDim embedDim | the dimension of the transformer embeddings. |
-> SDim inputEmbedDim | the dimension of the input embeddings for both the encoder and the decoder. |
-> SDim ffnDim | the dimension of the feed-forward network. |
-> SDim posEncDim | the dimension of the positional embeddings. |
-> SDim vocabDim | the dimension of the vocabulary. |
-> SHasDropout hasDropout | whether or not to use dropout. |
-> Double | the dropout rate. |
-> Double | the epsilon value for numerical stability of the layer normalization. |
-> ModelSpec (GEncoderDecoderTransformerF style transformerHead numEncoderLayers numDecoderLayers gradient device dataType headDim headEmbedDim embedDim inputEmbedDim ffnDim posEncDim vocabDim hasDropout) | the parameter specification of an encoder-decoder transformer model. |
Specifies the parameters of an encoder-decoder transformer model.
data GSimplifiedEncoderDecoderTransformer (model :: Type) (mkPos :: Type) (mkDecoderPos :: Type) (mkPaddingMask :: Type) (mkAttentionMask :: Type) (mkCrossAttentionMask :: Type) (mkDecoderAttentionMask :: Type) where Source #
GSimplifiedEncoderDecoderTransformer | |
|
Instances
Generic (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) :: Type -> Type Source # from :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Rep (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) x Source # to :: Rep (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) x -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask Source # | |
(Show model, Show mkPos, Show mkDecoderPos, Show mkPaddingMask, Show mkAttentionMask, Show mkCrossAttentionMask, Show mkDecoderAttentionMask) => Show (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder showsPrec :: Int -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> ShowS Source # show :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> String Source # showList :: [GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask] -> ShowS Source # | |
(Eq model, Eq mkPos, Eq mkDecoderPos, Eq mkPaddingMask, Eq mkAttentionMask, Eq mkCrossAttentionMask, Eq mkDecoderAttentionMask) => Eq (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder (==) :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Bool Source # (/=) :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Bool Source # | |
(Ord model, Ord mkPos, Ord mkDecoderPos, Ord mkPaddingMask, Ord mkAttentionMask, Ord mkCrossAttentionMask, Ord mkDecoderAttentionMask) => Ord (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder compare :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Ordering Source # (<) :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Bool Source # (<=) :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Bool Source # (>) :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Bool Source # (>=) :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> Bool Source # max :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask Source # min :: GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask Source # | |
(HasStateDict model, HasStateDict mkPos, HasStateDict mkDecoderPos, HasStateDict mkPaddingMask, HasStateDict mkAttentionMask, HasStateDict mkCrossAttentionMask, HasStateDict mkDecoderAttentionMask) => HasStateDict (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder fromStateDict :: (MonadIO m, MonadThrow m, MonadState StateDict m) => ModelSpec (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) -> StateDictKey -> m (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # toStateDict :: (MonadThrow m, MonadState StateDict m) => StateDictKey -> GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> m () Source # | |
(HasInitialize model generatorDevice model' generatorDevice0, HasInitialize mkPos generatorDevice0 mkPos' generatorDevice1, HasInitialize mkDecoderPos generatorDevice1 mkDecoderPos' generatorDevice2, HasInitialize mkPaddingMask generatorDevice2 mkPaddingMask' generatorDevice3, HasInitialize mkAttentionMask generatorDevice3 mkAttentionMask' generatorDevice4, HasInitialize mkCrossAttentionMask generatorDevice4 mkCrossAttentionMask' generatorDevice5, HasInitialize mkDecoderAttentionMask generatorDevice5 mkDecoderAttentionMask' generatorOutputDevice) => HasInitialize (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) generatorDevice (GSimplifiedEncoderDecoderTransformer model' mkPos' mkDecoderPos' mkPaddingMask' mkAttentionMask' mkCrossAttentionMask' mkDecoderAttentionMask') generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder initialize :: MonadThrow m => ModelSpec (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) -> Generator generatorDevice -> m (GSimplifiedEncoderDecoderTransformer model' mkPos' mkDecoderPos' mkPaddingMask' mkAttentionMask' mkCrossAttentionMask' mkDecoderAttentionMask', Generator generatorOutputDevice) Source # | |
(HasForward mkPaddingMask input generatorDevice inputPaddingMask generatorDevice, HasForward mkAttentionMask inputPaddingMask generatorDevice attentionMask generatorDevice, HasForward mkPos input generatorDevice pos generatorDevice, HasForward model (EncoderDecoderTransformerInput' input pos attentionMask) generatorDevice (EncoderDecoderTransformerOutput' encoderOutput) generatorOutputDevice) => HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerInput' input) generatorDevice (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerInput' input -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask, Generator generatorOutputDevice) Source # | |
(HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerInput input decoderInput) generatorDevice (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice, decoderInput ~ Tensor targetGradient targetLayout targetDevice targetDataType (IndexDims ('Indices '['SliceAll :: IndexType (Index Natural), 'SliceUpTo ('NegativeIndex 1)]) targetShape), decoderOutput ~ Tensor doGradient doLayout doDevice doDataType doShape, logProbsShape ~ SoftmaxF ('SelectDim ('ByIndex 2 :: By Symbol Natural)) doShape, Catch logProbsShape, unsqueezedTargetShape ~ UnsqueezeF ('SelectDim ('ByIndex 2 :: By Symbol Natural)) targetShape, Catch unsqueezedTargetShape, gatheredLogProbsShape ~ GatherDimF ('SelectDim ('ByIndex 2 :: By Symbol Natural)) unsqueezedTargetShape logProbsShape, Catch gatheredLogProbsShape, Catch (targetDataType <+> 'DataType 'Int64), logLikelihoodShape ~ SqueezeDimF ('SelectDim ('ByIndex 2 :: By Symbol Natural)) gatheredLogProbsShape, Catch logLikelihoodShape, MeanAllCheckF logLikelihoodShape, loss ~ Tensor (targetGradient <|> doGradient) (targetLayout <+> doLayout) (targetDevice <+> doDevice) doDataType ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])), generatorOutputDevice ~ generatorDevice) => HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerTrainingInput input (Tensor targetGradient targetLayout targetDevice targetDataType targetShape)) generatorDevice (SimplifiedEncoderDecoderTransformerTrainingOutput loss) generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerTrainingInput input (Tensor targetGradient targetLayout targetDevice targetDataType targetShape) -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerTrainingOutput loss, Generator generatorOutputDevice) Source # | |
(HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerInput' input) generatorDevice (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) generatorDevice', HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) generatorDevice' (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice) => HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerInput input decoderInput) generatorDevice (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice Source # |
|
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerInput input decoderInput -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask, Generator generatorOutputDevice) Source # | |
(HasForward mkPaddingMask decoderInput generatorDevice decoderInputPaddingMask generatorDevice, HasForward mkCrossAttentionMask (rightShiftedDecoderInput, inputPaddingMask) generatorDevice crossAttentionMask generatorDevice, HasForward mkDecoderAttentionMask rightShiftedDecoderInputPaddingMask generatorDevice decoderAttentionMask generatorDevice, HasForward (ShiftRight Int) decoderInput generatorDevice rightShiftedDecoderInput generatorDevice, HasForward (ShiftRight Int) decoderInputPaddingMask generatorDevice rightShiftedDecoderInputPaddingMask generatorDevice, HasForward mkDecoderPos rightShiftedDecoderInput generatorDevice decoderPos generatorDevice, HasForward model (EncoderDecoderTransformerGenerationInput rightShiftedDecoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput decoderOutput encoderOutput) generatorOutputDevice) => HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) generatorDevice (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice Source # |
|
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask, Generator generatorOutputDevice) Source # | |
type Rep (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) = D1 ('MetaData "GSimplifiedEncoderDecoderTransformer" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "GSimplifiedEncoderDecoderTransformer" 'PrefixI 'True) (((S1 ('MetaSel ('Just "sedtModel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 model) :*: S1 ('MetaSel ('Just "sedtDecoderInputShift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ShiftRight Int))) :*: (S1 ('MetaSel ('Just "sedtPaddingMaskShift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ShiftRight Int)) :*: S1 ('MetaSel ('Just "sedtMkPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 mkPos))) :*: ((S1 ('MetaSel ('Just "sedtMkDecoderPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 mkDecoderPos) :*: S1 ('MetaSel ('Just "sedtMkPaddingMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 mkPaddingMask)) :*: (S1 ('MetaSel ('Just "sedtMkAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 mkAttentionMask) :*: (S1 ('MetaSel ('Just "sedtMkCrossAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 mkCrossAttentionMask) :*: S1 ('MetaSel ('Just "sedtMkDecoderAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 mkDecoderAttentionMask)))))) | |
type ModelSpec (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type ModelSpec (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) = GSimplifiedEncoderDecoderTransformer (ModelSpec model) (ModelSpec mkPos) (ModelSpec mkDecoderPos) (ModelSpec mkPaddingMask) (ModelSpec mkAttentionMask) (ModelSpec mkCrossAttentionMask) (ModelSpec mkDecoderAttentionMask) |
data EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask where Source #
Input data type for use with an encoder-decoder transformer. Use this for training.
EncoderDecoderTransformerInput | |
|
Instances
(HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput' input pos attentionMask) generatorDevice (EncoderDecoderTransformerOutput' encoderOutput) generatorDevice', HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice' (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice Source # |
┌───────┐ ┌─────┐ ┌───────────────┐ ┌──────────────┐ ┌────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │ input │ │ pos │ │ attentionMask │ │ decoderInput │ │ decoderPos │ │ decoderAttentionMask │ │ crossAttentionMask │ └───┬───┘ └──┬──┘ └──────┬────────┘ └──────┬───────┘ └─────┬──────┘ └──────────┬───────────┘ └─────────┬──────────┘ │ │ │ │ │ │ │ ▼ │ │ │ │ │ │ edtSharedEmbedding│ │ │ │ │ │ ▼ │ │ │ │ │ │ (embedScaling) │ │ │ │ │ │ ▼ │ │ │ │ │ │ edtEncoder◄───┘◄───────────┘ ▼ │ │ │ │ edtSharedEmbedding │ │ │ │ ▼ │ │ │ │ (embedScaling) │ │ │ │ ▼ │ │ │ ├────────────────────────────────────►edtDecoder◄──────────┘◄───────────────────┘◄───────────────────────┘ │ ▼ │ (edtHead) │ │ ▼ ▼ ┌───────────────┐ ┌───────────────┐ │ encoderOutput │ │ decoderOutput │ └───────────────┘ └───────────────┘ |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput headOutput encoderOutput, Generator generatorOutputDevice) Source # | |
Generic (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) :: Type -> Type Source # from :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Rep (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) x Source # to :: Rep (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) x -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask Source # | |
(Show input, Show decoderInput, Show pos, Show decoderPos, Show attentionMask, Show decoderAttentionMask, Show crossAttentionMask) => Show (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder showsPrec :: Int -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> ShowS Source # show :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> String Source # showList :: [EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask] -> ShowS Source # | |
(Eq input, Eq decoderInput, Eq pos, Eq decoderPos, Eq attentionMask, Eq decoderAttentionMask, Eq crossAttentionMask) => Eq (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder (==) :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Bool Source # (/=) :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Bool Source # | |
(Ord input, Ord decoderInput, Ord pos, Ord decoderPos, Ord attentionMask, Ord decoderAttentionMask, Ord crossAttentionMask) => Ord (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder compare :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Ordering Source # (<) :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Bool Source # (<=) :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Bool Source # (>) :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Bool Source # (>=) :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Bool Source # max :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask Source # min :: EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask Source # | |
type Rep (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) = D1 ('MetaData "EncoderDecoderTransformerInput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "EncoderDecoderTransformerInput" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edtInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 input) :*: (S1 ('MetaSel ('Just "edtDecoderInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderInput) :*: S1 ('MetaSel ('Just "edtPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 pos))) :*: ((S1 ('MetaSel ('Just "edtDecoderPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderPos) :*: S1 ('MetaSel ('Just "edtAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 attentionMask)) :*: (S1 ('MetaSel ('Just "edtDecoderAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderAttentionMask) :*: S1 ('MetaSel ('Just "edtCrossAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 crossAttentionMask))))) |
data EncoderDecoderTransformerInput' input pos attentionMask where Source #
EncoderDecoderTransformerInput' | |
|
Instances
Generic (EncoderDecoderTransformerInput' input pos attentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder from :: EncoderDecoderTransformerInput' input pos attentionMask -> Rep (EncoderDecoderTransformerInput' input pos attentionMask) x Source # to :: Rep (EncoderDecoderTransformerInput' input pos attentionMask) x -> EncoderDecoderTransformerInput' input pos attentionMask Source # | |
(Show input, Show pos, Show attentionMask) => Show (EncoderDecoderTransformerInput' input pos attentionMask) Source # | |
(Eq input, Eq pos, Eq attentionMask) => Eq (EncoderDecoderTransformerInput' input pos attentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder (==) :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> Bool Source # (/=) :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> Bool Source # | |
(Ord input, Ord pos, Ord attentionMask) => Ord (EncoderDecoderTransformerInput' input pos attentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder compare :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> Ordering Source # (<) :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> Bool Source # (<=) :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> Bool Source # (>) :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> Bool Source # (>=) :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> Bool Source # max :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask Source # min :: EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask -> EncoderDecoderTransformerInput' input pos attentionMask Source # | |
(HasForward sharedEmbedding input generatorDevice embeddingOutput embeddingGeneratorOutputDevice, embeddingOutput ~ Tensor requiresGradient' layout' device' dataType' shape', HasForward encoder (embeddingOutput, pos, attentionMask) embeddingGeneratorOutputDevice encoderOutput generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput' input pos attentionMask) generatorDevice (EncoderDecoderTransformerOutput' encoderOutput) generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerInput' input pos attentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput' encoderOutput, Generator generatorOutputDevice) Source # | |
type Rep (EncoderDecoderTransformerInput' input pos attentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (EncoderDecoderTransformerInput' input pos attentionMask) = D1 ('MetaData "EncoderDecoderTransformerInput'" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "EncoderDecoderTransformerInput'" 'PrefixI 'True) (S1 ('MetaSel ('Just "edtInput'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 input) :*: (S1 ('MetaSel ('Just "edtPos'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 pos) :*: S1 ('MetaSel ('Just "edtAttentionMask'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 attentionMask)))) |
data SimplifiedEncoderDecoderTransformerInput input decoderInput where Source #
SimplifiedEncoderDecoderTransformerInput | |
|
Instances
data SimplifiedEncoderDecoderTransformerInput' input where Source #
SimplifiedEncoderDecoderTransformerInput' | |
|
Instances
data SimplifiedEncoderDecoderTransformerTrainingInput input target where Source #
SimplifiedEncoderDecoderTransformerTrainingInput | |
|
Instances
data EncoderDecoderTransformerOutput decoderOutput encoderOutput where Source #
Output data type for use with an encoder-decoder transformer.
EncoderDecoderTransformerOutput | |
|
Instances
Generic (EncoderDecoderTransformerOutput decoderOutput encoderOutput) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder from :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Rep (EncoderDecoderTransformerOutput decoderOutput encoderOutput) x Source # to :: Rep (EncoderDecoderTransformerOutput decoderOutput encoderOutput) x -> EncoderDecoderTransformerOutput decoderOutput encoderOutput Source # | |
(Show decoderOutput, Show encoderOutput) => Show (EncoderDecoderTransformerOutput decoderOutput encoderOutput) Source # | |
(Eq decoderOutput, Eq encoderOutput) => Eq (EncoderDecoderTransformerOutput decoderOutput encoderOutput) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder (==) :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Bool Source # (/=) :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Bool Source # | |
(Ord decoderOutput, Ord encoderOutput) => Ord (EncoderDecoderTransformerOutput decoderOutput encoderOutput) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder compare :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Ordering Source # (<) :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Bool Source # (<=) :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Bool Source # (>) :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Bool Source # (>=) :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> Bool Source # max :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput Source # min :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> EncoderDecoderTransformerOutput decoderOutput encoderOutput Source # | |
(HasForward sharedEmbedding decoderInput generatorDevice embeddingOutput' embeddingGeneratorOutputDevice', embeddingOutput' ~ Tensor requiresGradient'' layout'' device'' dataType'' shape'', HasForward decoder (embeddingOutput', encoderOutput, decoderPos, decoderAttentionMask, crossAttentionMask) embeddingGeneratorOutputDevice' decoderOutput decoderGeneratorOutputDevice, HasForward head decoderOutput decoderGeneratorOutputDevice headOutput generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice Source # |
┌───────────────┐ ┌──────────────┐ ┌────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │ encoderOutput │ │ decoderInput │ │ decoderPos │ │ decoderAttentionMask │ │ crossAttentionMask │ └───────┬───────┘ └───────┬──────┘ └──────┬─────┘ └───────────┬──────────┘ └──────────┬─────────┘ │ │ │ │ │ │ ▼ │ │ │ │ edtSharedEmbedding │ │ │ │ ▼ │ │ │ │ (embedScaling) │ │ │ │ ▼ │ │ │ ├────────────►edtDecoder◄───────────┘◄───────────────────┘◄───────────────────────┘ │ │ │ (edtHead) │ │ ▼ ▼ ┌───────────────┐ ┌───────────────┐ │ encoderOutput │ │ decoderOutput │ └───────────────┘ └───────────────┘ |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput headOutput encoderOutput, Generator generatorOutputDevice) Source # | |
(HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput' input pos attentionMask) generatorDevice (EncoderDecoderTransformerOutput' encoderOutput) generatorDevice', HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice' (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice Source # |
┌───────┐ ┌─────┐ ┌───────────────┐ ┌──────────────┐ ┌────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │ input │ │ pos │ │ attentionMask │ │ decoderInput │ │ decoderPos │ │ decoderAttentionMask │ │ crossAttentionMask │ └───┬───┘ └──┬──┘ └──────┬────────┘ └──────┬───────┘ └─────┬──────┘ └──────────┬───────────┘ └─────────┬──────────┘ │ │ │ │ │ │ │ ▼ │ │ │ │ │ │ edtSharedEmbedding│ │ │ │ │ │ ▼ │ │ │ │ │ │ (embedScaling) │ │ │ │ │ │ ▼ │ │ │ │ │ │ edtEncoder◄───┘◄───────────┘ ▼ │ │ │ │ edtSharedEmbedding │ │ │ │ ▼ │ │ │ │ (embedScaling) │ │ │ │ ▼ │ │ │ ├────────────────────────────────────►edtDecoder◄──────────┘◄───────────────────┘◄───────────────────────┘ │ ▼ │ (edtHead) │ │ ▼ ▼ ┌───────────────┐ ┌───────────────┐ │ encoderOutput │ │ decoderOutput │ └───────────────┘ └───────────────┘ |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput headOutput encoderOutput, Generator generatorOutputDevice) Source # | |
type Rep (EncoderDecoderTransformerOutput decoderOutput encoderOutput) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (EncoderDecoderTransformerOutput decoderOutput encoderOutput) = D1 ('MetaData "EncoderDecoderTransformerOutput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "EncoderDecoderTransformerOutput" 'PrefixI 'True) (S1 ('MetaSel ('Just "edtDecoderOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderOutput) :*: S1 ('MetaSel ('Just "edtEncoderOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 encoderOutput))) |
data EncoderDecoderTransformerOutput' encoderOutput where Source #
EncoderDecoderTransformerOutput' | |
|
Instances
data SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask where Source #
SimplifiedEncoderDecoderTransformerOutput | |
|
Instances
Generic (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) :: Type -> Type Source # from :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Rep (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) x Source # to :: Rep (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) x -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask Source # | |
(Show decoderOutput, Show encoderOutput, Show decoderInput, Show inputPaddingMask) => Show (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder showsPrec :: Int -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> ShowS Source # show :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> String Source # showList :: [SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask] -> ShowS Source # | |
(Eq decoderOutput, Eq encoderOutput, Eq decoderInput, Eq inputPaddingMask) => Eq (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder (==) :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Bool Source # (/=) :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Bool Source # | |
(Ord decoderOutput, Ord encoderOutput, Ord decoderInput, Ord inputPaddingMask) => Ord (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder compare :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Ordering Source # (<) :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Bool Source # (<=) :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Bool Source # (>) :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Bool Source # (>=) :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> Bool Source # max :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask Source # min :: SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask Source # | |
(HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerInput' input) generatorDevice (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) generatorDevice', HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) generatorDevice' (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice) => HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerInput input decoderInput) generatorDevice (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice Source # |
|
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerInput input decoderInput -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask, Generator generatorOutputDevice) Source # | |
(HasForward mkPaddingMask decoderInput generatorDevice decoderInputPaddingMask generatorDevice, HasForward mkCrossAttentionMask (rightShiftedDecoderInput, inputPaddingMask) generatorDevice crossAttentionMask generatorDevice, HasForward mkDecoderAttentionMask rightShiftedDecoderInputPaddingMask generatorDevice decoderAttentionMask generatorDevice, HasForward (ShiftRight Int) decoderInput generatorDevice rightShiftedDecoderInput generatorDevice, HasForward (ShiftRight Int) decoderInputPaddingMask generatorDevice rightShiftedDecoderInputPaddingMask generatorDevice, HasForward mkDecoderPos rightShiftedDecoderInput generatorDevice decoderPos generatorDevice, HasForward model (EncoderDecoderTransformerGenerationInput rightShiftedDecoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput decoderOutput encoderOutput) generatorOutputDevice) => HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) generatorDevice (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice Source # |
|
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask, Generator generatorOutputDevice) Source # | |
type Rep (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) = D1 ('MetaData "SimplifiedEncoderDecoderTransformerOutput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "SimplifiedEncoderDecoderTransformerOutput" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sedtDecoderOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderOutput) :*: S1 ('MetaSel ('Just "sedtEncoderOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 encoderOutput)) :*: (S1 ('MetaSel ('Just "sedtOriginalDecoderInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderInput) :*: S1 ('MetaSel ('Just "sedtInputPaddingMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 inputPaddingMask)))) |
data SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask where Source #
SimplifiedEncoderDecoderTransformerOutput' | |
|
Instances
data SimplifiedEncoderDecoderTransformerTrainingOutput loss where Source #
SimplifiedEncoderDecoderTransformerTrainingOutput | |
|
Instances
data EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask where Source #
Input data type for use with an encoder-decoder transformer. Use this for inference.
EncoderDecoderTransformerGenerationInput | |
|
Instances
Generic (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) :: Type -> Type Source # from :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Rep (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) x Source # to :: Rep (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) x -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask Source # | |
(Show decoderInput, Show encoderOutput, Show decoderPos, Show decoderAttentionMask, Show crossAttentionMask) => Show (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder showsPrec :: Int -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> ShowS Source # show :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> String Source # showList :: [EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask] -> ShowS Source # | |
(Eq decoderInput, Eq encoderOutput, Eq decoderPos, Eq decoderAttentionMask, Eq crossAttentionMask) => Eq (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder (==) :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Bool Source # (/=) :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Bool Source # | |
(Ord decoderInput, Ord encoderOutput, Ord decoderPos, Ord decoderAttentionMask, Ord crossAttentionMask) => Ord (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder compare :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Ordering Source # (<) :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Bool Source # (<=) :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Bool Source # (>) :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Bool Source # (>=) :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Bool Source # max :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask Source # min :: EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask Source # | |
(HasForward sharedEmbedding decoderInput generatorDevice embeddingOutput' embeddingGeneratorOutputDevice', embeddingOutput' ~ Tensor requiresGradient'' layout'' device'' dataType'' shape'', HasForward decoder (embeddingOutput', encoderOutput, decoderPos, decoderAttentionMask, crossAttentionMask) embeddingGeneratorOutputDevice' decoderOutput decoderGeneratorOutputDevice, HasForward head decoderOutput decoderGeneratorOutputDevice headOutput generatorOutputDevice) => HasForward (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput headOutput encoderOutput) generatorOutputDevice Source # |
┌───────────────┐ ┌──────────────┐ ┌────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │ encoderOutput │ │ decoderInput │ │ decoderPos │ │ decoderAttentionMask │ │ crossAttentionMask │ └───────┬───────┘ └───────┬──────┘ └──────┬─────┘ └───────────┬──────────┘ └──────────┬─────────┘ │ │ │ │ │ │ ▼ │ │ │ │ edtSharedEmbedding │ │ │ │ ▼ │ │ │ │ (embedScaling) │ │ │ │ ▼ │ │ │ ├────────────►edtDecoder◄───────────┘◄───────────────────┘◄───────────────────────┘ │ │ │ (edtHead) │ │ ▼ ▼ ┌───────────────┐ ┌───────────────┐ │ encoderOutput │ │ decoderOutput │ └───────────────┘ └───────────────┘ |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput headOutput encoderOutput, Generator generatorOutputDevice) Source # | |
type Rep (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) = D1 ('MetaData "EncoderDecoderTransformerGenerationInput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "EncoderDecoderTransformerGenerationInput" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edtGenerationDecoderInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderInput) :*: S1 ('MetaSel ('Just "edtGenerationEncoderOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 encoderOutput)) :*: (S1 ('MetaSel ('Just "edtGenerationDecoderPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderPos) :*: (S1 ('MetaSel ('Just "edtGenerationDecoderAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderAttentionMask) :*: S1 ('MetaSel ('Just "edtGenerationCrossAttentionMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 crossAttentionMask))))) |
data SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask where Source #
SimplifiedEncoderDecoderTransformerGenerationInput | |
|
Instances
Generic (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) :: Type -> Type Source # from :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Rep (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) x Source # to :: Rep (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) x -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask Source # | |
(Show decoderInput, Show encoderOutput, Show inputPaddingMask) => Show (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder showsPrec :: Int -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> ShowS Source # show :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> String Source # showList :: [SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask] -> ShowS Source # | |
(Eq decoderInput, Eq encoderOutput, Eq inputPaddingMask) => Eq (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder (==) :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Bool Source # (/=) :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Bool Source # | |
(Ord decoderInput, Ord encoderOutput, Ord inputPaddingMask) => Ord (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder compare :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Ordering Source # (<) :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Bool Source # (<=) :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Bool Source # (>) :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Bool Source # (>=) :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Bool Source # max :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask Source # min :: SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask Source # | |
(HasForward mkPaddingMask decoderInput generatorDevice decoderInputPaddingMask generatorDevice, HasForward mkCrossAttentionMask (rightShiftedDecoderInput, inputPaddingMask) generatorDevice crossAttentionMask generatorDevice, HasForward mkDecoderAttentionMask rightShiftedDecoderInputPaddingMask generatorDevice decoderAttentionMask generatorDevice, HasForward (ShiftRight Int) decoderInput generatorDevice rightShiftedDecoderInput generatorDevice, HasForward (ShiftRight Int) decoderInputPaddingMask generatorDevice rightShiftedDecoderInputPaddingMask generatorDevice, HasForward mkDecoderPos rightShiftedDecoderInput generatorDevice decoderPos generatorDevice, HasForward model (EncoderDecoderTransformerGenerationInput rightShiftedDecoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) generatorDevice (EncoderDecoderTransformerOutput decoderOutput encoderOutput) generatorOutputDevice) => HasForward (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) generatorDevice (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) generatorOutputDevice Source # |
|
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask, Generator generatorOutputDevice) Source # | |
type Rep (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) Source # | |
Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder type Rep (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) = D1 ('MetaData "SimplifiedEncoderDecoderTransformerGenerationInput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "SimplifiedEncoderDecoderTransformerGenerationInput" 'PrefixI 'True) (S1 ('MetaSel ('Just "sedtGenerationDecoderInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderInput) :*: (S1 ('MetaSel ('Just "sedtGenerationEncoderOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 encoderOutput) :*: S1 ('MetaSel ('Just "sedtGenerationInputPaddingMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 inputPaddingMask)))) |