TorchLean NN: Attention #
Attention with optional affine projection biases and dropout on softmax probabilities.
The operation order is projection, head splitting, scaled dot products, masked softmax, probability dropout, value aggregation, and output projection. Dropout therefore removes individual query/key contributions before values are mixed.
Instances For
Include one state slot only when the corresponding option is enabled.
Instances For
Initial value for an optional state slot, with no placeholder when it is disabled.
Instances For
Native initialization follows the same optional shape list as the ordinary state pack.
Instances For
Read one optional state slot and return the remaining, still shape-indexed references.
Instances For
Configurable affine self-attention with optional probability dropout.
The first four state slots remain queryWeight, keyWeight, valueWeight, outputWeight.
Enabling input bias appends queryBias, keyBias, valueBias; enabling output bias appends
outputBias; enabling dropout appends its non-trainable scalar probability. Disabled options
allocate no state slots. All biases start at zero and consume no initialization seeds.