The BATCHED EfficientNet-B0 block forwards and graphs (true batch-norm, matches the render) #
The EfficientNet peer of MobileNetV2StagesPC. EfficientNet's render (EfficientNetRender.Basic) emits
true batch-norm (reduce μ/var over the batch+spatial axes [0,2,3] per channel —
bnBatchTensor4), which couples the batch. So the forward graph here lives at the batched
index
N·(c·h·w) (StableHLO.batchOp/StableHLO.bnBatchF, StableHLO.Basic):
- every batch-separable op (conv / strided conv / depthwise / strided depthwise / dense / GAP / the
whole SE block) is
batchMap Nof the proven per-example op (SHlo.batchOp+BatchableOp/denOp); - swish is the batched pointwise descriptor (
.batchOp .swish, denoting the flatswishFbyden_batchOp_swish_eq_swishF) and the residual add is.addVB— the tokens the render emits, soprettyof each block graph is the rendered block's text (Codegen/FwdGraphTextTies), names included: SE denseszW1/zb1/zW2/zb2, conv biasesbiasName false, classifier%Wd/%bd; - the one batch-coupled op, true batch-norm, is
SHlo.bnBatchF, denotingbnBatchLA(= the provenbnBatchTensor4, reindexed to the network's left-assocN·(oc·h·w)flat layout).
This file proves the FORWARD half — den (graph) = forward — for the stride-2 stem
conv-bn-swish (stemGraphB_faithful), an MBConv1 (t=1, no expand) SE block
(mbNoExpGraphB_faithful), an MBConv6 expand SE block with a stride-2 downsample
(mbStridedGraphB_faithful), an MBConv6 expand SE block with an identity residual skip
(mbResidGraphB_faithful), and the 1×1 conv-bn-swish head, GAP and the dense classifier
(headGraphB_faithful) — all with true batch-norm and the squeeze-excite gate (seBlockFull,
entering as BatchableOp.seBlock = batchMap N seBlockFull). B0's fifth block form, the
stride-1 expand block with no skip, is mbExpGraphB_faithful in EfficientNetFullB0.
Faithfulness is per-block (*GraphB_faithful: den (block graph) = block forward (den input)),
so EfficientNetFullB0 chains the sixteen-block net without the kernel reducing it at once.
All five theorems are in tests/AuditAxioms.lean's #print axioms list.
MBConv1 (t=1, no expand): depthwise-bn-swish → SE → project-bn. No residual (ic ≠ oc).
Equations
- Proofs.mbNoExpFwdB N Wd bd εd γd βd Wz₁ bz₁ Wz₂ bz₂ Wp bp εp γp βp = Proofs.projB N Wp bp εp γp βp ∘ Proofs.seB N Wz₁ bz₁ Wz₂ bz₂ ∘ Proofs.dwbsB N Wd bd εd γd βd
Instances For
MBConv6 with a stride-2 downsample: expand-bn-swish (at 2h×2w) → strided depthwise-bn-swish
→ SE → project-bn. No residual (spatial changes).
Equations
- One or more equations did not get rendered due to their size.
Instances For
MBConv6 with an identity residual skip (s=1 ∧ ic=oc=c): x + (project ∘ SE ∘ depthwise ∘ expand)(x).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Head: 1×1 conv-bn-swish → global-avg-pool → dense classifier, all batched.
Equations
- Proofs.headFwdB N Wh bh εh γh βh Wfc bfc = Proofs.StableHLO.batchMap N (Proofs.dense Wfc bfc) ∘ Proofs.StableHLO.batchMap N (Proofs.globalAvgPoolFlat oc h w) ∘ Proofs.cbsB N Wh bh εh γh βh
Instances For
MBConv1 (no expand): dw-bn-swish → SE → project-bn, batched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
MBConv6 strided: expand-bn-swish (at 2h×2w) → strided dw-bn-swish → SE → project-bn, batched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
MBConv6 with identity residual: addVB body skip, body = project ∘ SE ∘ dw ∘ expand, batched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Head: 1×1 conv-bn-swish → GAP → dense, batched.
Equations
- One or more equations did not get rendered due to their size.