SelfAttention class

A single head of self-attention.

This module allows tokens in a sequence to interact with and attend to each other.

Inheritance

Constructors

SelfAttention(int embedSize, int headSize, {bool masked = false})

Properties

hashCode int
The hash code for this object.
no setterinherited
headSize int
final
key Layer
final
masked bool
final
query Layer
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Layer
final

Methods

forward(List<ValueVector> x) List<ValueVector>
Forward pass for a single self-attention head.
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