TransformerDecoderBlock class
A single Transformer Decoder block.
This block combines masked Multi-Head Self-Attention, Multi-Head Cross-Attention, and a Feed-Forward Network, each with residual connections and layer normalization.
Constructors
- TransformerDecoderBlock(int embedSize, int numHeads, int encoderEmbedSize)
Properties
- crossAttention → MultiHeadCrossAttention
-
final
- embedSize → int
-
final
- ffn → FeedForward
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- ln1 → LayerNorm
-
final
- ln2 → LayerNorm
-
final
- ln3 → LayerNorm
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selfAttention → MultiHeadAttention
-
final
Methods
-
forward(
List< ValueVector> x_decoder, List<ValueVector> x_encoder) → List<ValueVector> - The forward pass through a single Transformer Decoder block.
-
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