hasktorch-gradually-typed-0.2.0.0: experimental project for hasktorch
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Synopsis

Documentation

data EncoderDecoderTransformerHasEmbedScaling Source #

Data type that is used to represent whether the encoder-decoder transformer model has a scaled embedding.

Instances

Instances details
Generic EncoderDecoderTransformerHasEmbedScaling Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Show EncoderDecoderTransformerHasEmbedScaling Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Eq EncoderDecoderTransformerHasEmbedScaling Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Ord EncoderDecoderTransformerHasEmbedScaling Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

HasStateDict EncoderDecoderTransformerHasEmbedScaling Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

HasInitialize EncoderDecoderTransformerHasEmbedScaling generatorDevice EncoderDecoderTransformerHasEmbedScaling generatorDevice Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep EncoderDecoderTransformerHasEmbedScaling Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep EncoderDecoderTransformerHasEmbedScaling = D1 ('MetaData "EncoderDecoderTransformerHasEmbedScaling" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "EncoderDecoderTransformerWithEmbedScaling" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EncoderDecoderTransformerWithoutEmbedScaling" 'PrefixI 'False) (U1 :: Type -> Type))
type ModelSpec EncoderDecoderTransformerHasEmbedScaling Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

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.

Constructors

GEncoderDecoderTransformer 

Fields

Instances

Instances details
Generic (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for encoder-decoder transformers with optional head. Use this instance for sequence generation once the encoder's output is available.

┌───────────────┐  ┌──────────────┐  ┌────────────┐  ┌──────────────────────┐  ┌────────────────────┐
│ encoderOutput │  │ decoderInput │  │ decoderPos │  │ decoderAttentionMask │  │ crossAttentionMask │
└───────┬───────┘  └───────┬──────┘  └──────┬─────┘  └───────────┬──────────┘  └──────────┬─────────┘
        │                  │                │                    │                        │
        │                  ▼                │                    │                        │
        │          edtSharedEmbedding       │                    │                        │
        │                  ▼                │                    │                        │
        │            (embedScaling)         │                    │                        │
        │                  ▼                │                    │                        │
        ├────────────►edtDecoder◄───────────┘◄───────────────────┘◄───────────────────────┘
        │                  │
        │              (edtHead)
        │                  │
        ▼                  ▼
┌───────────────┐  ┌───────────────┐
│ encoderOutput │  │ decoderOutput │
└───────────────┘  └───────────────┘
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for encoder-decoder transformers with optional head.

    ┌───────┐  ┌─────┐  ┌───────────────┐  ┌──────────────┐  ┌────────────┐  ┌──────────────────────┐  ┌────────────────────┐
    │ input │  │ pos │  │ attentionMask │  │ decoderInput │  │ decoderPos │  │ decoderAttentionMask │  │ crossAttentionMask │
    └───┬───┘  └──┬──┘  └──────┬────────┘  └──────┬───────┘  └─────┬──────┘  └──────────┬───────────┘  └─────────┬──────────┘
        │         │            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
edtSharedEmbedding│            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
  (embedScaling)  │            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
    edtEncoder◄───┘◄───────────┘                  ▼                │                    │                        │
        │                                 edtSharedEmbedding       │                    │                        │
        │                                         ▼                │                    │                        │
        │                                   (embedScaling)         │                    │                        │
        │                                         ▼                │                    │                        │
        ├────────────────────────────────────►edtDecoder◄──────────┘◄───────────────────┘◄───────────────────────┘
        │                                         ▼
        │                                     (edtHead)
        │                                         │
        ▼                                         ▼
┌───────────────┐                         ┌───────────────┐
│ encoderOutput │                         │ decoderOutput │
└───────────────┘                         └───────────────┘
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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

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 #

Equations

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.

Equations

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.

Equations

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.

Equations

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.

Equations

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 #

Arguments

:: 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. ST5, SBART, etc.

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

Constructors

GSimplifiedEncoderDecoderTransformer 

Fields

Instances

Instances details
Generic (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for simplified encoder-decoder models.

Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for simplified encoder-decoder models. Use this instance for sequence generation once the encoder's output is available.

Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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

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.

Constructors

EncoderDecoderTransformerInput 

Fields

Instances

Instances details
(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 #

HasForward instance for encoder-decoder transformers with optional head.

    ┌───────┐  ┌─────┐  ┌───────────────┐  ┌──────────────┐  ┌────────────┐  ┌──────────────────────┐  ┌────────────────────┐
    │ input │  │ pos │  │ attentionMask │  │ decoderInput │  │ decoderPos │  │ decoderAttentionMask │  │ crossAttentionMask │
    └───┬───┘  └──┬──┘  └──────┬────────┘  └──────┬───────┘  └─────┬──────┘  └──────────┬───────────┘  └─────────┬──────────┘
        │         │            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
edtSharedEmbedding│            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
  (embedScaling)  │            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
    edtEncoder◄───┘◄───────────┘                  ▼                │                    │                        │
        │                                 edtSharedEmbedding       │                    │                        │
        │                                         ▼                │                    │                        │
        │                                   (embedScaling)         │                    │                        │
        │                                         ▼                │                    │                        │
        ├────────────────────────────────────►edtDecoder◄──────────┘◄───────────────────┘◄───────────────────────┘
        │                                         ▼
        │                                     (edtHead)
        │                                         │
        ▼                                         ▼
┌───────────────┐                         ┌───────────────┐
│ encoderOutput │                         │ decoderOutput │
└───────────────┘                         └───────────────┘
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (EncoderDecoderTransformerInput input decoderInput pos decoderPos attentionMask decoderAttentionMask crossAttentionMask) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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 #

Constructors

EncoderDecoderTransformerInput' 

Fields

Instances

Instances details
Generic (EncoderDecoderTransformerInput' input pos attentionMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (EncoderDecoderTransformerInput' input pos attentionMask) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

showsPrec :: Int -> EncoderDecoderTransformerInput' input pos attentionMask -> ShowS Source #

show :: EncoderDecoderTransformerInput' input pos attentionMask -> String Source #

showList :: [EncoderDecoderTransformerInput' input pos attentionMask] -> ShowS Source #

(Eq input, Eq pos, Eq attentionMask) => Eq (EncoderDecoderTransformerInput' input pos attentionMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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 #

Constructors

SimplifiedEncoderDecoderTransformerInput 

Fields

Instances

Instances details
Generic (SimplifiedEncoderDecoderTransformerInput input decoderInput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (SimplifiedEncoderDecoderTransformerInput input decoderInput) :: Type -> Type Source #

(Show input, Show decoderInput) => Show (SimplifiedEncoderDecoderTransformerInput input decoderInput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

(Eq input, Eq decoderInput) => Eq (SimplifiedEncoderDecoderTransformerInput input decoderInput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

(Ord input, Ord decoderInput) => Ord (SimplifiedEncoderDecoderTransformerInput input decoderInput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

(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 #

HasForward instance for simplified encoder-decoder models.

Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

type Rep (SimplifiedEncoderDecoderTransformerInput input decoderInput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep (SimplifiedEncoderDecoderTransformerInput input decoderInput) = D1 ('MetaData "SimplifiedEncoderDecoderTransformerInput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "SimplifiedEncoderDecoderTransformerInput" 'PrefixI 'True) (S1 ('MetaSel ('Just "sedtInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 input) :*: S1 ('MetaSel ('Just "sedtDecoderInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 decoderInput)))

data SimplifiedEncoderDecoderTransformerInput' input where Source #

Constructors

SimplifiedEncoderDecoderTransformerInput' 

Fields

Instances

Instances details
Generic (SimplifiedEncoderDecoderTransformerInput' input) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (SimplifiedEncoderDecoderTransformerInput' input) :: Type -> Type Source #

Show input => Show (SimplifiedEncoderDecoderTransformerInput' input) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Eq input => Eq (SimplifiedEncoderDecoderTransformerInput' input) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Ord input => Ord (SimplifiedEncoderDecoderTransformerInput' input) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerInput' input -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask, Generator generatorOutputDevice) Source #

type Rep (SimplifiedEncoderDecoderTransformerInput' input) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep (SimplifiedEncoderDecoderTransformerInput' input) = D1 ('MetaData "SimplifiedEncoderDecoderTransformerInput'" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "SimplifiedEncoderDecoderTransformerInput'" 'PrefixI 'True) (S1 ('MetaSel ('Just "sedtInput'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 input)))

data SimplifiedEncoderDecoderTransformerTrainingInput input target where Source #

Constructors

SimplifiedEncoderDecoderTransformerTrainingInput 

Fields

Instances

Instances details
Generic (SimplifiedEncoderDecoderTransformerTrainingInput input target) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (SimplifiedEncoderDecoderTransformerTrainingInput input target) :: Type -> Type Source #

(Show input, Show target) => Show (SimplifiedEncoderDecoderTransformerTrainingInput input target) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

(Eq input, Eq target) => Eq (SimplifiedEncoderDecoderTransformerTrainingInput input target) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

(Ord input, Ord target) => Ord (SimplifiedEncoderDecoderTransformerTrainingInput input target) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

type Rep (SimplifiedEncoderDecoderTransformerTrainingInput input target) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep (SimplifiedEncoderDecoderTransformerTrainingInput input target) = D1 ('MetaData "SimplifiedEncoderDecoderTransformerTrainingInput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "SimplifiedEncoderDecoderTransformerTrainingInput" 'PrefixI 'True) (S1 ('MetaSel ('Just "sedtTrainingInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 input) :*: S1 ('MetaSel ('Just "sedtTarget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 target)))

data EncoderDecoderTransformerOutput decoderOutput encoderOutput where Source #

Output data type for use with an encoder-decoder transformer.

Constructors

EncoderDecoderTransformerOutput 

Fields

Instances

Instances details
Generic (EncoderDecoderTransformerOutput decoderOutput encoderOutput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (EncoderDecoderTransformerOutput decoderOutput encoderOutput) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

showsPrec :: Int -> EncoderDecoderTransformerOutput decoderOutput encoderOutput -> ShowS Source #

show :: EncoderDecoderTransformerOutput decoderOutput encoderOutput -> String Source #

showList :: [EncoderDecoderTransformerOutput decoderOutput encoderOutput] -> ShowS Source #

(Eq decoderOutput, Eq encoderOutput) => Eq (EncoderDecoderTransformerOutput decoderOutput encoderOutput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for encoder-decoder transformers with optional head. Use this instance for sequence generation once the encoder's output is available.

┌───────────────┐  ┌──────────────┐  ┌────────────┐  ┌──────────────────────┐  ┌────────────────────┐
│ encoderOutput │  │ decoderInput │  │ decoderPos │  │ decoderAttentionMask │  │ crossAttentionMask │
└───────┬───────┘  └───────┬──────┘  └──────┬─────┘  └───────────┬──────────┘  └──────────┬─────────┘
        │                  │                │                    │                        │
        │                  ▼                │                    │                        │
        │          edtSharedEmbedding       │                    │                        │
        │                  ▼                │                    │                        │
        │            (embedScaling)         │                    │                        │
        │                  ▼                │                    │                        │
        ├────────────►edtDecoder◄───────────┘◄───────────────────┘◄───────────────────────┘
        │                  │
        │              (edtHead)
        │                  │
        ▼                  ▼
┌───────────────┐  ┌───────────────┐
│ encoderOutput │  │ decoderOutput │
└───────────────┘  └───────────────┘
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for encoder-decoder transformers with optional head.

    ┌───────┐  ┌─────┐  ┌───────────────┐  ┌──────────────┐  ┌────────────┐  ┌──────────────────────┐  ┌────────────────────┐
    │ input │  │ pos │  │ attentionMask │  │ decoderInput │  │ decoderPos │  │ decoderAttentionMask │  │ crossAttentionMask │
    └───┬───┘  └──┬──┘  └──────┬────────┘  └──────┬───────┘  └─────┬──────┘  └──────────┬───────────┘  └─────────┬──────────┘
        │         │            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
edtSharedEmbedding│            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
  (embedScaling)  │            │                  │                │                    │                        │
        ▼         │            │                  │                │                    │                        │
    edtEncoder◄───┘◄───────────┘                  ▼                │                    │                        │
        │                                 edtSharedEmbedding       │                    │                        │
        │                                         ▼                │                    │                        │
        │                                   (embedScaling)         │                    │                        │
        │                                         ▼                │                    │                        │
        ├────────────────────────────────────►edtDecoder◄──────────┘◄───────────────────┘◄───────────────────────┘
        │                                         ▼
        │                                     (edtHead)
        │                                         │
        ▼                                         ▼
┌───────────────┐                         ┌───────────────┐
│ encoderOutput │                         │ decoderOutput │
└───────────────┘                         └───────────────┘
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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 #

Constructors

EncoderDecoderTransformerOutput' 

Fields

Instances

Instances details
Generic (EncoderDecoderTransformerOutput' encoderOutput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (EncoderDecoderTransformerOutput' encoderOutput) :: Type -> Type Source #

Show encoderOutput => Show (EncoderDecoderTransformerOutput' encoderOutput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Eq encoderOutput => Eq (EncoderDecoderTransformerOutput' encoderOutput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Ord encoderOutput => Ord (EncoderDecoderTransformerOutput' encoderOutput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

forward :: MonadThrow m => GEncoderDecoderTransformer inputEmbedDim encoder decoder sharedEmbedding head -> EncoderDecoderTransformerInput' input pos attentionMask -> Generator generatorDevice -> m (EncoderDecoderTransformerOutput' encoderOutput, Generator generatorOutputDevice) Source #

type Rep (EncoderDecoderTransformerOutput' encoderOutput) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep (EncoderDecoderTransformerOutput' 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 "edtEncoderOutput'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 encoderOutput)))

data SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask where Source #

Constructors

SimplifiedEncoderDecoderTransformerOutput 

Fields

Instances

Instances details
Generic (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (SimplifiedEncoderDecoderTransformerOutput decoderOutput encoderOutput decoderInput inputPaddingMask) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for simplified encoder-decoder models.

Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for simplified encoder-decoder models. Use this instance for sequence generation once the encoder's output is available.

Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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 #

Constructors

SimplifiedEncoderDecoderTransformerOutput' 

Fields

Instances

Instances details
Generic (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) :: Type -> Type Source #

Methods

from :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Rep (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) x Source #

to :: Rep (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) x -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask Source #

(Show encoderOutput, Show inputPaddingMask) => Show (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

showsPrec :: Int -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> ShowS Source #

show :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> String Source #

showList :: [SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask] -> ShowS Source #

(Eq encoderOutput, Eq inputPaddingMask) => Eq (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

(==) :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Bool Source #

(/=) :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Bool Source #

(Ord encoderOutput, Ord inputPaddingMask) => Ord (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

compare :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Ordering Source #

(<) :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Bool Source #

(<=) :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Bool Source #

(>) :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Bool Source #

(>=) :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> Bool Source #

max :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask Source #

min :: SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask -> SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask 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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

forward :: MonadThrow m => GSimplifiedEncoderDecoderTransformer model mkPos mkDecoderPos mkPaddingMask mkAttentionMask mkCrossAttentionMask mkDecoderAttentionMask -> SimplifiedEncoderDecoderTransformerInput' input -> Generator generatorDevice -> m (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask, Generator generatorOutputDevice) Source #

type Rep (SimplifiedEncoderDecoderTransformerOutput' encoderOutput inputPaddingMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep (SimplifiedEncoderDecoderTransformerOutput' encoderOutput 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 "sedtEncoderOutput'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 encoderOutput) :*: S1 ('MetaSel ('Just "sedtInputPaddingMask'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 inputPaddingMask)))

data SimplifiedEncoderDecoderTransformerTrainingOutput loss where Source #

Instances

Instances details
Generic (SimplifiedEncoderDecoderTransformerTrainingOutput loss) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Show loss => Show (SimplifiedEncoderDecoderTransformerTrainingOutput loss) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Eq loss => Eq (SimplifiedEncoderDecoderTransformerTrainingOutput loss) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Ord loss => Ord (SimplifiedEncoderDecoderTransformerTrainingOutput loss) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

type Rep (SimplifiedEncoderDecoderTransformerTrainingOutput loss) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

type Rep (SimplifiedEncoderDecoderTransformerTrainingOutput loss) = D1 ('MetaData "SimplifiedEncoderDecoderTransformerTrainingOutput" "Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "SimplifiedEncoderDecoderTransformerTrainingOutput" 'PrefixI 'True) (S1 ('MetaSel ('Just "sedtLoss") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 loss)))

data EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask where Source #

Input data type for use with an encoder-decoder transformer. Use this for inference.

Constructors

EncoderDecoderTransformerGenerationInput 

Fields

Instances

Instances details
Generic (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (EncoderDecoderTransformerGenerationInput decoderInput encoderOutput decoderPos decoderAttentionMask crossAttentionMask) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for encoder-decoder transformers with optional head. Use this instance for sequence generation once the encoder's output is available.

┌───────────────┐  ┌──────────────┐  ┌────────────┐  ┌──────────────────────┐  ┌────────────────────┐
│ encoderOutput │  │ decoderInput │  │ decoderPos │  │ decoderAttentionMask │  │ crossAttentionMask │
└───────┬───────┘  └───────┬──────┘  └──────┬─────┘  └───────────┬──────────┘  └──────────┬─────────┘
        │                  │                │                    │                        │
        │                  ▼                │                    │                        │
        │          edtSharedEmbedding       │                    │                        │
        │                  ▼                │                    │                        │
        │            (embedScaling)         │                    │                        │
        │                  ▼                │                    │                        │
        ├────────────►edtDecoder◄───────────┘◄───────────────────┘◄───────────────────────┘
        │                  │
        │              (edtHead)
        │                  │
        ▼                  ▼
┌───────────────┐  ┌───────────────┐
│ encoderOutput │  │ decoderOutput │
└───────────────┘  └───────────────┘
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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 #

Constructors

SimplifiedEncoderDecoderTransformerGenerationInput 

Fields

Instances

Instances details
Generic (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Associated Types

type Rep (SimplifiedEncoderDecoderTransformerGenerationInput decoderInput encoderOutput inputPaddingMask) :: Type -> Type Source #

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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 #

HasForward instance for simplified encoder-decoder models. Use this instance for sequence generation once the encoder's output is available.

Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.GEncoderDecoder

Methods

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

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