Derivative of General Convolution #
This file proves the derivative and reverse-mode formulas for channels-first convolution at an arbitrary spatial rank. All sums use bounded multi-indices; no axis count is fixed in a theorem. The forward coordinate map is bilinear in kernel and input. The input-gradient adjoint identity requires positive strides so the forward and transpose index relations agree. These are exact-real specification results; they do not establish correspondence with native LibTorch kernels.
Read a channel and bounded spatial coordinate from a channels-first tensor.
Instances For
Read two leading channels followed by a bounded spatial coordinate.
Instances For
Split a channels-first tensor dot product into channel and spatial sums.
Expand a channels-first lookup into the unique bounded spatial coordinate that it names.
The scalar coefficient connecting one input coordinate to one output coordinate.
Instances For
One coordinate of the generic convolution contraction, written as finite sums.
Convolution is the matrix represented by convCoefficient at every spatial rank.
One kernel-gradient coordinate is the contraction of input and output cotangent.
One bias-gradient coordinate is the spatial sum of the output cotangent.
Broadcasting a bias reads the same channel value at every spatial coordinate.
One input-gradient coordinate is the specification's transpose-index contraction.
The specification's input gradient multiplies by the transposed coefficient matrix.
Adjoint identities #
The forward input map and input-gradient specification are adjoint at every spatial rank.
The kernel contraction and kernel-gradient specification are adjoint.
Bias broadcasting and spatial reduction are adjoint.
Fréchet derivative #
Euclidean coordinates indexed by a tensor shape list.
Instances For
Build shape-indexed Euclidean coordinates from a coordinate function.
Instances For
Coordinates of coordVecOfFun f are the values of f.
Vectorize a tensor using bounded multi-indices rather than flattened natural indices.
Instances For
Coordinate i of a vectorized tensor is the tensor entry at i.
Convolution is indexed by bounded multi-indices rather than one flat Fin, because the stride and
padding arithmetic is stated per axis; keeping the vectorization multi-indexed means no flattening
appears in any of the derivative proofs.
The kernel/input contraction in Euclidean coordinates.
Instances For
Unfolds one output coordinate of the contraction into its double sum.
Tensor convolution and its Euclidean-coordinate contraction agree at every spatial rank.
Euclidean kernel coordinates for a rank-general convolution.
Instances For
Euclidean input coordinates for a rank-general convolution.
Instances For
Euclidean output coordinates for a rank-general convolution.
Instances For
The convolution contraction is additive in its input coordinates.
The convolution contraction respects scalar multiplication in its input coordinates.
The convolution contraction is additive in its kernel coordinates.
The convolution contraction respects scalar multiplication in its kernel coordinates.
Continuous bilinear form of rank-general convolution.
Instances For
The bundled bilinear map computes the same contraction as convCoreVec.
Bundling matters: once convolution is a continuous bilinear map, its derivative in each argument comes from mathlib rather than a separate difference-quotient argument.
Continuous linear bias broadcast in Euclidean coordinates.
Instances For
Bias broadcast copies the channel entry to every spatial position of that channel.
Coordinate conversion preserves pointwise tensor addition.
Tensor bias broadcasting agrees with the corresponding coordinate map.
Coordinate form of a complete convolution layer, including bias.
Instances For
Tensor-level convSpec agrees with convForwardVec.
Euclidean state space of one rank-general convolution application.
Instances For
Product-rule derivative of a complete convolution state.
Instances For
The exact derivative of a rank-general convolution is its kernel/input product rule plus bias.
Applying the analytic derivative gives the tensor-level convolution JVP.
The convolution backward specification is the adjoint of the exact JVP.
The ConvGradients fields pair the kernel, bias, and input gradients with their corresponding
tangents. Positive strides are needed for the transpose input-index relation.