The depthwise adjoint gate + leaf ties #
The certified-VJP ties for the three CNNs (ConvNeXt / MobileNetV2 / EfficientNet) all reverse a
depthwise convolution, so they all need the depthwise twin of the conv adjoint gate
IR.convBackDenote_eq_input_grad_formula. This file builds it once.
depthwiseConv2d_dwReverse_eq_input_grad_formula— the gate: the emitted reversed-kernel forward depthwise convdepthwiseConv2d (dwReverse W) 0equals the certified depthwise input-gradientdepthwiseConv2dInputGradFormula W, for arbitrary dims with odd kernels. The exact depthwise analogue of the conv gate — same(kh,kw) ↦ (kh+hi-pH, kw+wi-pW)partial bijection on the pad supports, MINUS theΣ cochannel sum (depthwise has no cross-channel mixing, so the input channel reads only from its own kernel/gradient channelch).depthwiseFlatBack_eq_vjp_backward— the stride-1 leaf tie: the backward mapdepthwiseFlatBack W(=depthwiseFlat (dwReverse W) 0) IS the certified depthwise input-VJP(depthwiseFlatHasVJP W b).backward x(depthwise conv is linear ⇒ the saved activationxis ignored). The depthwise peer ofconvFlatBack_eq_vjp_backward.depthwiseStride2FlatXlaBack_eq_vjp_backward— the XLA-SAMEstrided leaf tie:depthwiseStride2FlatXlaBack W(=depthwiseFlatBack ∘ decimateOddBack) IS(depthwiseStride2FlatXlaHasVJP W b).backward x, for odd kernels.
The depthwise conv-adjoint identity (odd kernels), all dims. The emitted reversed-kernel
forward depthwise conv depthwiseConv2d (dwReverse W) 0 equals the certified depthwise
input-gradient depthwiseConv2dInputGradFormula W, for arbitrary c h w kH kW with odd
kernels. The depthwise twin of IR.convBackDenote_eq_input_grad_formula: no Σ co (depthwise
channel ch is fixed), so per output coordinate it is IR.reverseSlab_eq_gradSlab at the
channel's own slabs W ch, dy ch. The leaf the depthwise certified-VJP ties (convnext/mnv2/enet) stand
on.
Depthwise conv input-VJP leaf tie. The backward map depthwiseFlatBack W (= reversed-kernel
forward depthwise conv) IS the certified depthwise input-VJP (depthwiseFlatHasVJP W b).backward x (depthwise conv is linear, so the saved activation x is ignored), for odd kernels. Routes
through depthwiseConv2d_dwReverse_eq_input_grad_formula; the depthwise peer of
convFlatBack_eq_vjp_backward.
XLA-SAME strided depthwise input-VJP leaf tie. depthwiseStride2FlatXlaBack W
(= depthwiseFlatBack ∘ decimateOddBack) IS the certified
(depthwiseStride2FlatXlaHasVJP W b).backward x, for odd kernels. MobileNetV2's four
strided depthwises and B0's downsample depthwise, at the TF-origin convention.