TransformerBlock class

A single Transformer block, which combines attention and feed-forward layers.

Inheritance

Constructors

TransformerBlock(int embedSize, int numHeads, {bool masked = false})

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