EncoderDecoderTransformer class

A full Encoder-Decoder Transformer model for sequence-to-sequence tasks.

This model uses a TransformerEncoder to process the source sequence and a TransformerDecoder to generate the target sequence, leveraging cross-attention over the encoder's output.

Inheritance

Constructors

EncoderDecoderTransformer({required int sourceVocabSize, required int targetVocabSize, required int embedSize, required int sourceBlockSize, required int targetBlockSize, required int numLayers, required int numHeads})

Properties

decoder TransformerDecoder
final
encoder TransformerEncoder
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

forward(List<int> sourceIdx, List<int> targetIdx) List<ValueVector>
Forward pass for the Encoder-Decoder Transformer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parameters() List<Value>
override
toString() String
A string representation of this object.
inherited
zeroGrad() → void
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited