LayerNorm graph #
The explicit SSA graph used by the LayerNorm proofs: a seqLen × embedDim input is normalized
across its last axis, the row statistics are broadcast back over each token, and the affine
parameters gamma/beta are broadcast over the sequence axis. The graph is written as an
explicit snoc chain so that every prefix has a name; the calculus proofs in
NN.Proofs.Autograd.Tape.Ops.Norm.LayerNorm and the evaluation lemmas in
NN.Proofs.Autograd.Tape.Ops.Norm.LayerNormEval refer to these prefixes directly.
The nodes are the shape-generic tape nodes: row mean, row and column broadcast, elementwise
arithmetic, the clamped square root sqrt (max x 0), and inversion.
Matrix shape m×n.
Instances For
Rank-one tensor shape k.
Instances For
Input context shapes: [X, gamma, beta] for layer norm over the last axis.
Instances For
First 6 intermediates in the LayerNorm computation (up to var_eps).
Instances For
Prefix intermediates up to std (adds one more vector).
Instances For
Full list of intermediates for the LayerNorm graph in this file.
Instances For
Index of the input matrix X in the base LayerNorm context ΓLN m n ++ ss.
Instances For
Index of the scale vector gamma in the base LayerNorm context ΓLN m n ++ ss.
Instances For
Index of the shift vector beta in the base LayerNorm context ΓLN m n ++ ss.
Instances For
Full LayerNorm graph (as an explicit snoc chain).
Instances For
Index of the final LayerNorm output in ΓLN ++ ssLayerNorm.