DAG Normalization Primitives #
RMS normalization and regularized L2 normalization with a nonempty final axis. The L2 epsilon is an unchecked scalar input; callers choose a positive value.
Adapt the shared leading-axis traversal to the final-axis shape convention.
Instances For
RMS normalization of a single vector.
The spec is written for a batch, so a lone vector is normalized by wrapping it in a one-element
batch and reading the result back out. hWidth is what rules out dividing by an empty mean.
Instances For
Apply RMS normalization with a shared final-axis scale over an arbitrary leading shape.
Instances For
With no leading axes, RMS normalization uses the single-vector spec.
Leading axes distribute over RMS normalization without changing the row computation.
Pure evaluation of final-axis RMS normalization with a shared scale.
Apply regularized L2 normalization over the final axis of an arbitrary tensor.
Instances For
With no batch axes left, the graph node is the regularized L2 normalization spec.
Batch axes distribute over L2 normalization.
Normalize the final axis by sqrt(sum (x * x) + epsilon).
This is not torch.nn.functional.normalize, which divides by max(‖x‖, epsilon). The two agree
for nonzero real vectors when epsilon = 0; positive epsilon changes the denominator in general.
The stabilizer is a scalar graph input rather than a declaration parameter. This keeps the exact numerical convention visible in captured graphs and permits architectures to select their own positive epsilon without adding another primitive.
Instances For
Pure evaluation of final-axis regularized L2 normalization.