Positional Encodings #
Configuration records for learned positions, fixed sinusoidal encodings, and rotary positional
embeddings. The seeded constructors live in NN.API.Seeded.
Learned positional embedding configuration.
This is a trainable parameter tensor of shape (sequenceLength × embeddingWidth) that is broadcast
across batchShape and added to the input.
- initialization : Init.Scheme
Initialization scheme for the positional embedding table.
Instances For
Sinusoidal positional encoding configuration.
Classic non-trainable Transformer sinusoidal encoding, added to token embeddings.
startPosition is an absolute-position offset for KV-cache decoding.
- startPosition : ℕ
Absolute position offset for the first row of the encoding table.
Instances For
Rotary positional embedding (RoPE) configuration.
startPosition is an absolute-position offset for KV-cache decoding.
- startPosition : ℕ
Absolute position offset for the first row of RoPE angles.