Chapter 4: CIFAR-10 2D CNN (no BatchNorm) — whole-network VJP #
The Chapter-4 demo model cifarCnn (the no-BN CIFAR-10 spec):
conv 3→32 (relu) → conv 32→32 (relu) → maxPool 2×2 → conv 32→64 (relu) → conv 64→64 (relu) → maxPool 2×2 → flatten → dense 4096→512 (relu) → dense 512→512 (relu) → dense 512→10
i.e. two conv→conv→maxPool stages (channels 3→32→32, then 32→64→64) and a three-layer dense head, on 32×32 RGB input with two 2×2 pools (32→16→8).
This is the Chapter-3 mnistCnnNoBn machinery scaled up: the same
convRelu/denseRelu/maxPoolFlat building blocks, chained through
vjpCompAt, just longer and with two maxpool steps. Spatial bookkeeping
uses the final pooled size (h, w) as the unit: the second conv stage runs at
(2h, 2w), the first at (2·(2h), 2·(2w)) — exactly the Chapter-3 (2h, 2w)
convention nested one level deeper (so the two pools read maxPoolFlat _ (2h) (2w)
and maxPoolFlat _ h w).
cifarCnnHasVJPAt— the structural whole-network VJP: the composed backward equals thepdiv-Jacobian VJP of the full forward pass, conditional on smoothness at the six ReLU kinks and the two MaxPools. The Chapter-4 sibling ofmnistCnnNoBnHasVJPAt.Tiny.cifarTinyCnnHasVJP_correct— a concrete instance where every smoothness hypothesis is discharged (positivity + positional injectivity through both pools), so the statement is unconditional and closes under the three-axiom kernel. The non-vacuity witness for the conditional capstone.
The Chapter-4 cifarCnn forward, in flattened Vec space. The conv stack
runs at spatial (2·(2h), 2·(2w)); the first maxPool halves it to
(2h, 2w) (where the second conv stage runs), the second to (h, w); then
three dense layers (two with ReLU). With the real CIFAR shapes
ic=3, c1=32, c2=64, h=w=8, d1=512, nClasses=10, kH=kW=3 the input width is
3·32·32 = 3072 and the flattened pool output is 64·8·8 = 4096.
Equations
- One or more equations did not get rendered due to their size.
Instances For
CIFAR 2D CNN (no BN) whole-network VJP at a smooth point.
The composed backward of the full Chapter-4 forward equals the
pdiv-contracted Jacobian, conditional on smoothness at the six ReLU kinks
and the two MaxPools. Built by vjpCompAt through
convRelu → convRelu → maxPool → convRelu → convRelu → maxPool → denseRelu → denseRelu → dense. The Chapter-4 sibling of
mnistCnnNoBnHasVJPAt (two conv stages, two pools).
Equations
- One or more equations did not get rendered due to their size.
Instances For
16 distinct positive values, 4×4 row-major ⇒ positionally injective. Typed
at the 2·(2·1) spatial form so it lines up syntactically with the forward's
stage-1 input shape (no 2*2 vs 2*(2*1) cast friction).
Equations
- Proofs.Tiny.T0 x✝ hi wi = ↑(4 * ↑hi + ↑wi + 1)
Instances For
Dense heads: nonnegative weights + a strictly-positive bias keep every activation off the ReLU kink.
Equations
- Proofs.Tiny.Wd5 x✝¹ x✝ = 1
Instances For
Unconditional whole-network VJP for a concrete tiny CIFAR CNN. Every
smoothness hypothesis of cifarCnnHasVJPAt is discharged — the two
no-tie conditions via positional injectivity (maxPool2Smooth_of_injective,
the second through pool1_inj), the six ReLU conditions via positivity —
so the statement carries no side conditions and stays in the three-axiom
closure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The deeper (8-conv) CIFAR forward, flattened. Four conv→conv→pool stages
(ic→c1→c1, c1→c2→c2, c2→c3→c3, c3→c4→c4) then dense 3-head.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Deeper (8-conv) CIFAR CNN (no BN) whole-network VJP at a smooth point.
Conditional on the ten ReLU kinks (eight conv, hf1 … hf8; two dense, hf9, hfa) and
the four MaxPools (hp1 … hp4); built by vjpCompAt through convRelu×8 / maxPool×4 /
denseRelu×2 / dense. The 4-stage sibling of cifarCnnHasVJPAt. No concrete instance of
this 4-stage net is proved; Tiny.cifarTinyCnnHasVJPAt is a concrete instance of the
2-stage cifarCnnHasVJPAt with every side condition discharged.
Equations
- One or more equations did not get rendered due to their size.
Instances For
conv → per-channel-BN → relu block VJP at a smooth point. The per-channel
(bnPerChannelTensor3, m=h·w) sibling of convBnReluHasVJPAt: the same two
vjpCompAt chain with bnPerChannelTensor3 (vector γ/β [oc], its own
block-diagonal VJP) in place of the scalar-global bnForward.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The 8-conv CIFAR forward with per-channel BatchNorm (bnPerChannelTensor3) between each
conv and its ReLU, flattened: four conv→BN→relu→conv→BN→relu→pool stages, then the dense
3-layer head. The BN peer of cifarCnn8Forward.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Deeper (8-conv) CIFAR CNN with per-channel BatchNorm, whole-network VJP at a smooth
point. Conditional on 0 < εᵢ (hε₁ … hε₈), the eight post-BN ReLU kinks (h1 … h8),
the two dense ReLU kinks (h9, ha), and the four MaxPool conditions
(h_mp1 … h_mp4, each a MaxPool2Smooth).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Public correctness theorem for cifarCnnBn8HasVJPAt — its backward equals the
pdiv-contracted Jacobian of cifarCnnBn8Forward at x.