Closing the CIFAR-BN render — the BN parameter-gradient bridges (dγ, dβ certified) #
The non-BN closes (cnn_render_conv{W,b}_certified + the M2 dense bridges) and the BN
input-grad (bnPerChannel_grad_input_correct, under 0<ε) already cover every
parameter of the CIFAR-BN train step except the per-channel BN scale/shift γ, β. This
file supplies their bridges — the BN analogue of IR.bias_grad_bridge / conv_bias_grad.
γ and β enter BN affinely: per channel c, y_(c,s) = γ_c · x̂_(c,s) + β_c, and x̂
does not depend on γ or β. So as a function of γ (resp. β), per-channel BN is
x̂ ⊙ gather_channel(γ) + const (resp. const + gather_channel(β)) — a constant scaled
by a channel-gather, plus a constant. Its Jacobian therefore collapses through
pdiv_add/pdiv_mul/pdiv_const/pdiv_reindex to the sparse indicator
∂y_j/∂γ_idx = x̂_j·[chan j = idx] (resp. [chan j = idx]), and contracting with the
cotangent dy gives exactly the rendered per-channel reduces
dγ_c = Σ_s dy·x̂, dβ_c = Σ_s dy (the bnParamGradPC block in
cifarBnTrainStepStructured). Unlike the BN input grad these need no 0<ε (affine in the
params; ε only enters the constant x̂). See planning/archive/render_close_handoff.md §2b.
BN γ-gradient bridge. The rendered per-channel dγ_idx = Σ_s dy·x̂ equals the
certified Jacobian of per-channel BN (as a function of γ) contracted with the
cotangent dy. The BN analogue of the conv/dense weight bridges; affine in γ, so no
0<ε.
BN β-gradient bridge. The rendered per-channel dβ_idx = Σ_s dy equals the
certified Jacobian of per-channel BN (as a function of β) contracted with dy. The
BN analogue of bias_grad_bridge; affine in β, so no 0<ε.