The batch-statistics cifar8-BN net — every gradient node IS the loss's derivative #
Cifar8BbnStepTieB.cifar8Bbn_train_step_tiedB ties the 38 gradient nodes of the cifar8wb_bbn_*
steps, each at the cotangent the rendered chain threads to it; Cifar8BbnWholeBackB says that
chain is the certified whole-net backward. This file is the rung above both: at those cotangents,
the loss of the WHOLE net with one parameter varied is differentiable in it and the node is its
gradient (HasGradAt), for any loss L of the logits with gradient g there
(cifar8Bbn_net_lossGrad). The batched peer of Cifar8BnParamGrad.cifar8Bn_net_lossGrad
(the per-image net) and of ResNet34ParamGrad.r34_net_lossGrad.
The pools #
A 2×2 max pool has no derivative at a window whose maximum is attained twice, and after a ReLU
every dead window is such a tie. So, as the per-image rung and ResNet-34's stem do, the pools are
frozen at a selection σ (one cell per window per example): the pool is then the gather at
σ, and PoolSelB.maxPoolB_relu_eventuallyEq_sel says the pooled ReLU IS that gather along any
parameter, near a point where every window is dead or tied only between twins — cells equal at
every value of the weights upstream of that pool (C8PoolTwin1 … C8PoolTwin4). The gradient is
then of the gather model, which is smooth, and the chain's pool cotangent is the scatter along σ
(selScatter). At σ = argmax that scatter is the render's maxPoolBackB
(PoolSelB.batchMapAux_maxPoolBackFlat_eq_selScatter), which is how cifar8Bbn_net_lossGrad's
chain is the node tie's.
How it is built #
c8Z1 … c8Z8— the eight pre-ReLU activations (c8Aₖ = relu c8Zₖ);C8PoolTwinⱼ— twins of poolj, stated onc8Z₂ⱼat every record;Cifar8BbnLossSmoothAt— the hypotheses.c8S₁ … c8S₈— the loss read from stagek's pre-activation through the REAL net;c8G₁ … c8G₈— the same through the gather model.c8_germ_stageₖ: along any parameter path through stagek's weights, the two agree near the point.cifar8Bbn_net_lossGrad— the head byhasGradAt_denseB/hasGradAt_relu, the body by the gather model pulled back one op at a time (hasGradAt_gatherReluB,hasGradAt_bnBatchLA,hasGradAt_conv,hasGradAt_relu), each node by itsParamGradNodeslemma, and each transported to the real net by its stage's germ.
Scope #
One device; the conv weight nodes on the renderers' bf16 switch (convWAt_hasGradAt), the
others carry no flag. The smoothed-CE instantiation at the artifacts' own cotangent is
cifar8Bbn_net_lossGrad_CE.
Stage 1's pre-activation: BN₁ of conv₁.
Equations
- Proofs.c8Z1 N p ε x = Proofs.StableHLO.bnBatchLA N c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε p.γ₁ p.β₁ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₁ p.b₁) x)
Instances For
Stage 2's pre-activation, pool 1's input before its ReLU.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 3's pre-activation.
Equations
- Proofs.c8Z3 N p ε x = Proofs.StableHLO.bnBatchLA N c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε p.γ₃ p.β₃ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₃ p.b₃) (Proofs.c8P1 N p ε x))
Instances For
Stage 4's pre-activation, pool 2's input before its ReLU.
Equations
- Proofs.c8Z4 N p ε x = Proofs.StableHLO.bnBatchLA N c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε p.γ₄ p.β₄ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₄ p.b₄) (Proofs.c8A3 N p ε x))
Instances For
Stage 5's pre-activation.
Equations
- Proofs.c8Z5 N p ε x = Proofs.StableHLO.bnBatchLA N c3 (2 * (2 * h)) (2 * (2 * w)) ε p.γ₅ p.β₅ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₅ p.b₅) (Proofs.c8P2 N p ε x))
Instances For
Stage 6's pre-activation, pool 3's input before its ReLU.
Equations
- Proofs.c8Z6 N p ε x = Proofs.StableHLO.bnBatchLA N c3 (2 * (2 * h)) (2 * (2 * w)) ε p.γ₆ p.β₆ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₆ p.b₆) (Proofs.c8A5 N p ε x))
Instances For
Stage 7's pre-activation.
Equations
- Proofs.c8Z7 N p ε x = Proofs.StableHLO.bnBatchLA N c4 (2 * h) (2 * w) ε p.γ₇ p.β₇ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₇ p.b₇) (Proofs.c8P3 N p ε x))
Instances For
Stage 8's pre-activation, pool 4's input before its ReLU.
Equations
- Proofs.c8Z8 N p ε x = Proofs.StableHLO.bnBatchLA N c4 (2 * h) (2 * w) ε p.γ₈ p.β₈ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₈ p.b₈) (Proofs.c8A7 N p ε x))
Instances For
Example r's cell (ci, p) in the batched [N, c, H, W] index.
Equations
- Proofs.bIdx N r ci q = finProdFinEquiv (r, Proofs.t3Idx ci q.1 q.2)
Instances For
Twins of pool 1 (example r): equal in every channel at every record of weights. Pool 1's
pre-activation reads only stages 1 and 2, so this is "equal at every weight upstream"; p fixes
the widths.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Twins of pool 2 (example r).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Twins of pool 3 (example r).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Twins of pool 4 (example r).
Equations
- One or more equations did not get rendered due to their size.
Instances For
What the loss gradient needs at x: every pre-ReLU activation off zero (the eight stages
and the two head layers); every pool's windows, in every example, dead or tied only between
that pool's twins; each selection naming a maximum of every window of its pool's input.
- pool1 : SmallParamGrad.MaxPool2SmoothUpToB N (C8PoolTwin1 N p ε x) (c8Z2 N p ε x)
- sel1 : SmallParamGrad.PoolSelDomB N σ₁ (c8A2 N p ε x)
- pool2 : SmallParamGrad.MaxPool2SmoothUpToB N (C8PoolTwin2 N p ε x) (c8Z4 N p ε x)
- sel2 : SmallParamGrad.PoolSelDomB N σ₂ (c8A4 N p ε x)
- pool3 : SmallParamGrad.MaxPool2SmoothUpToB N (C8PoolTwin3 N p ε x) (c8Z6 N p ε x)
- sel3 : SmallParamGrad.PoolSelDomB N σ₃ (c8A6 N p ε x)
- pool4 : SmallParamGrad.MaxPool2SmoothUpToB N (C8PoolTwin4 N p ε x) (c8Z8 N p ε x)
- sel4 : SmallParamGrad.PoolSelDomB N σ₄ (c8A8 N p ε x)
Instances For
The head: dense₉, relu, denseₐ, relu, dense_b, then L.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real: from stage 8's pre-activation.
Equations
- Proofs.c8S8 N p L y = Proofs.c8Gp4 N p L (Proofs.StableHLO.batchMap N (Proofs.maxPoolFlat c4 h w) (Proofs.relu (N * (c4 * (2 * h) * (2 * w))) y))
Instances For
Real: from stage 7's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real: from stage 6's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real: from stage 5's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real: from stage 4's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real: from stage 3's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real: from stage 2's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real: from stage 1's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gather model: from stage 8's pre-activation, pool 4 frozen at σ₄.
Equations
- Proofs.c8G8 N p L σ₄ y = Proofs.c8Gp4 N p L fun (k : Fin (N * (c4 * h * w))) => Proofs.relu (N * (c4 * (2 * h) * (2 * w))) y (Proofs.SmallParamGrad.poolSelIdxB N σ₄ k)
Instances For
Gather model: from stage 7's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gather model: from stage 6's pre-activation, pool 3 frozen at σ₃.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gather model: from stage 5's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gather model: from stage 4's pre-activation, pool 2 frozen at σ₂.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gather model: from stage 3's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gather model: from stage 2's pre-activation, pool 1 frozen at σ₁.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gather model: from stage 1's pre-activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 7's pre-activation to stage 8's: ReLU, conv₈, BN₈.
Equations
- Proofs.c8Up8of7 N p ε y = Proofs.StableHLO.bnBatchLA N c4 (2 * h) (2 * w) ε p.γ₈ p.β₈ (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₈ p.b₈) (Proofs.relu (N * (c4 * (2 * h) * (2 * w))) y))
Instances For
Stage 6's to stage 7's: ReLU, pool 3, conv₇, BN₇.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 4's to stage 5's: ReLU, pool 2, conv₅, BN₅.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 3's to stage 4's.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 2's to stage 3's: ReLU, pool 1, conv₃, BN₃.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 1's to stage 2's.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Twins of pool j, along a pre-activation path: equal at every θ.
Equations
- Proofs.TwinAlong N T Z = ∀ (θ : Proofs.Vec P) (r : Fin N) (ci : Fin c) (q q' : Fin H × Fin W), T r q q' → Z θ (Proofs.bIdx N r ci q) = Z θ (Proofs.bIdx N r ci q')
Instances For
Every batch-statistics cifar8-BN gradient node is the gradient of L in that parameter:
the 38 nodes Cifar8BbnStepTieB ties, each at the cotangent the chain threads to its layer
with every pool routed at its selection, stated against L of cifar8BbnForwardB with that
one parameter varied. The conv weight nodes are on the renderers' bf16 switch.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every batch-statistics cifar8-BN gradient node is the gradient of L in that parameter,
whenever g is L's gradient at the logits. Hypotheses: 0 < ε; every ReLU off its kink,
every pool window dead or tied only between that pool's twins, each selection naming a maximum
of every window (Cifar8BbnLossSmoothAt); hL.
The step tie's one-row casts are BackLinks' (rowB, unrowB), by definition.
The emitted cifar8-bbn loss cotangent is the smoothed chain at zero smoothing: the
render's scaleB invB (subB (unrow softmaxRow) t) is smoothedLossCotGraph at α = 0 and
divisor invB⁻¹, read back through unrowB.
The artifact's loss has the emitted cotangent as its gradient, at any target whose rows each sum to one and any positive class count.
At the artifact's loss: every node is the gradient of the batch-mean softmax
cross-entropy at the soft target t (the graph input %onehot), with g the cotangent the
render composes from softmaxRow, subB and scaleB — the chain cifar8Bbn_train_step_tiedB
reads, at castB1 = rowB and unB1 = unrowB.