TransformerEncoderBlock class

A single Transformer Encoder block.

This block consists of a Multi-Head Self-Attention layer and a Feed-Forward Network, each with residual connections and layer normalization (pre-normalization).

Inheritance

Constructors

TransformerEncoderBlock(int embedSize, int numHeads)

Properties

attention → MultiHeadAttention
final
embedSize → int
final
ffn → FeedForward
final
hashCode → int
The hash code for this object.
no setterinherited
ln1 → LayerNorm
final
ln2 → LayerNorm
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

forward(List<ValueVector> x) → List<ValueVector>
The forward pass through a single Transformer Encoder 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