Softmax at arbitrary rank #
Each output coordinate belongs to one last-axis row. Selecting that row is a linear map, so the vector softmax derivative applies after row selection at every tensor rank. The coordinate identities below use the actual max-shifted specification; no uniqueness assumption on the maximum is needed.
Coordinate functions give the finite-dimensional space on which we differentiate. Constructing the input tensor and reading the output are explicit in the derivative statement.
Number of entries in a last-axis row; the scalar convention has one entry.
Instances For
The last coordinate of a tensor coordinate, with index zero for a scalar.
Instances For
Replace the last coordinate while keeping all leading coordinates fixed.
Instances For
Read one last-axis row from a tensor's coordinate function.
Instances For
Applying the row-selection map reads exactly that row.
The only coordinate of a one-entry softmax is one.
A rank-one tensor's selected row is its ordinary Euclidean vectorization.
Selecting a row after taking a leading slice selects the same coordinates.
The stable innermost specification is the analytic vector softmax on the selected row.
The proof reduces each leading axis structurally, then uses the proved cancellation of the max shift in the vector kernel. Empty axes require no special numerical convention: they have no output coordinate at which the equality could fail.
The max-shifted softmax specification is Fréchet differentiable at every tensor rank.
The one-entry softmax has zero differential.
The supplied innermost backward rule is the vector JVP on each selected row.
Applying the analytic derivative computes the actual specification's backward formula.
The actual last-axis softmax derivative is its supplied backward rule at every rank.
The rank-general backward map is self-adjoint under the tensor inner product.