Documentation

LeanMlir.Proofs.Nets.EfficientNet.EfficientNetStepTie

PoC: the full-16 EfficientNet-B0 train step §1a TIE (whole-net thread) — DONE (capstone efficientnet_net_tied, all 262 params, 3-axiom clean; only the optional dense-head fold below remains) #

The EfficientNet-B0 §1a tie (its batched, un-fused peer is EnetTiePoCG.efficientnet_net_tiedG). The §1 fold (EfficientNetFold) gives every batched param-SGD op den = certified ∀ cotangent; this file pins each cotangent to the actual loss-driven backward chain of the rendered net — threading the real forward activations through every param op and composing the backward cotangent from the loss down through all 16 MBConv blocks (with the residual fan-in at every stride-1 skip AND the SE gate fan-in), so each output's den = certified becomes a single composed theorem with the forward = the proven efficientnetForwardB_full.

What is NEW vs mnv2's tie (the harder content, hence a dedicated effort):

Landed so far (all 3-axiom clean — [propext, Classical.choice, Quot.sound]) #

Remaining (optional refinement) #

Chain-cotangent helpers — the per-op batched backward steps (built fresh, HasVJP-style) #

EfficientNetChainClose proves the per-block VJPs by vjp_comp of the per-op VJPs but exposes no explicit cotangent-vector defs (unlike mnv2's invresCot*). So the tie BUILDS the chain cotangents from the proven per-op backwards: bnBackB (true-BN, the batch-coupled bnBatchLA VJP), swBackB (swish, smooth), cInB/dInB (the batched conv/depthwise input-VJP = den convBackBatched/ depthwiseBackBatched), seInB (the fused SE input-cot = den seBackBatched), gateCotB (the SE gate cotangent = den seReduceB), sigBackB, rowDenseBackFlat (the SE excite/reduce backs). Every helper IS a .backward of a proven VJP (or the exact den of the emitted backward op), so the cotangents are the genuine loss-driven backward, not a free ∀c. reassocB bridges the conv/swish index (oc·h·w) to the BN param-op index (oc·(h·w)).

noncomputable def Proofs.EnetTiePoC.reassocB (N oc h w : ) (v : Vec (N * (oc * h * w))) :
Vec (N * (oc * (h * w)))

(oc·h·w) → (oc·(h·w)) batched reassociation reindex — bridges the conv/swish chain index to the BN γ/β + conv-bias op index (EnetPoC.bn{Gamma,Beta}B_den consume Vec (N·(oc·(h·w)))).

Equations
Instances For
    noncomputable def Proofs.EnetTiePoC.bnBackB (N oc h w : ) (ε : ) ( : 0 < ε) (γ β : Vec oc) (x dy : Vec (N * (oc * h * w))) :
    Vec (N * (oc * h * w))

    Batched true-BN input-cotangent (bnBatchLA VJP — batch-coupled).

    Equations
    Instances For
      theorem Proofs.EnetTiePoC.den_bnBatchLABack_eq_bnBatchBack {N oc h w : } (gN xN es : String) (ε : ) (γ : Vec oc) (x : Vec (N * (oc * h * w))) (e : StableHLO.SHlo (N * (oc * h * w))) :
      StableHLO.den (StableHLO.SHlo.bnBatchLABack gN xN es ε γ x e) = fun (i : Fin (N * (oc * h * w))) => StableHLO.den (StableHLO.SHlo.bnBatchBack gN xN es ε γ (reassocB N oc h w x) (StableHLO.SHlo.operand "" (reassocB N oc h w (StableHLO.den e)))) (Fin.cast i)

      The tie's BN node and the emitted BN node denote one map. Every batched render emits .bnBatchBack, typed at N·(oc·(h·w)); the ties state the BN input cotangent at .bnBatchLABack, its network-layout N·(oc·h·w) twin (ResNet34TieB.bnInB). The two print the same text, and their dens differ only by the associativity relabelling reassocB: the two scatters inside bnBatchLABack's den collapse because Fin.cast is a bijection.

      theorem Proofs.EnetTiePoC.bnBackB_eq_den_bnBatchBack (N oc h w : ) (ε : ) ( : 0 < ε) (γ β : Vec oc) (x dy : Vec (N * (oc * h * w))) :
      bnBackB N oc h w ε γ β x dy = fun (i : Fin (N * (oc * h * w))) => StableHLO.den (StableHLO.SHlo.bnBatchBack "" "" "" ε γ (reassocB N oc h w x) (StableHLO.SHlo.operand "" (reassocB N oc h w dy))) (Fin.cast i)

      The certified BN input cotangent every batched T3 tie threads IS the emitted bnBatchBack node's den, read back through reassocB. This is the missing half of bnBatchLABack_faithful: that lemma certifies the tie's node, this one says the render's node computes the same numbers.

      noncomputable def Proofs.EnetTiePoC.swBackB (n : ) (x dy : Vec n) :
      Vec n

      Batched swish mask-back (smooth, no kink).

      Equations
      Instances For
        noncomputable def Proofs.EnetTiePoC.sigBackB (n : ) (x dy : Vec n) :
        Vec n

        Batched sigmoid back (the SE gate excite-dense output cotangent).

        Equations
        Instances For
          noncomputable def Proofs.EnetTiePoC.cInB (N : ) {ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (dy : Vec (N * (oc * h * w))) :
          Vec (N * (ic * h * w))

          Batched 1×1/conv input-VJP (= den convBackBatched; conv is linear, x unused).

          Equations
          Instances For
            noncomputable def Proofs.EnetTiePoC.dInB (N : ) {c h w kH kW : } (W : DepthwiseKernel c kH kW) (b : Vec c) (dy : Vec (N * (c * h * w))) :
            Vec (N * (c * h * w))

            Batched depthwise input-VJP (= den depthwiseBackBatched).

            Equations
            Instances For
              noncomputable def Proofs.EnetTiePoC.dStridedInB (N : ) {c h w kH kW : } (W : DepthwiseKernel c kH kW) (b : Vec c) (dy : Vec (N * (c * h * w))) :
              Vec (N * (c * (2 * h) * (2 * w)))

              Batched strided depthwise input-VJP (= den depthwiseStridedBackBatched; upsamples h→2h).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def Proofs.EnetTiePoC.gapInB (N c h w : ) (dy : Vec (N * c)) :
                Vec (N * (c * h * w))

                Batched GAP input-VJP (= den gapBackBatched; the head's GAP backward, broadcast÷(h·w)).

                Equations
                Instances For
                  noncomputable def Proofs.EnetTiePoC.seInB (N : ) {c h w r : } (W₁ : Mat c r) (b₁ : Vec r) (W₂ : Mat r c) (b₂ : Vec c) (x dy : Vec (N * (c * h * w))) :
                  Vec (N * (c * h * w))

                  Batched fused SE input-cotangent (= den seBackBatched, the x⊙gate VJP).

                  Equations
                  Instances For
                    noncomputable def Proofs.EnetTiePoC.gateCotB (N c h w : ) (x dy : Vec (N * (c * h * w))) :
                    Vec (N * c)

                    Batched SE gate cotangent dgate[n,c] = Σ_{h,w}(x⊙dy) (= den seReduceB, the broadcast-adjoint of x ⊙ dy — the FIRST step of the SE gate backward, feeding the SE dense param grads).

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Residual stride-1 MBConv block — all 16 params tied (expand → dw → SE → project + skip) #

                      The centerpiece: exercises the genuinely-new content vs mnv2 — swish masks (smooth), the SE gate fan-in (gateCotBsigBackB → {zW₂,zb₂} → rowDenseBackFlat → swBackB → {zW₁,zb₁}), and true batch-norm backward (bnBackB), all at the batched index N·(c·h·w). Backward from dyOut (cot at project-BN out): project-BN-back → project-conv-back (cot at SE out) → SE backward (fused dx for the depthwise side; un-fused gate-cot for the SE params) → depthwise swish/BN/conv backs → expand swish/BN/conv backs. Residual (ic=oc=c): the block-input cotangent fan-in + dyOut lives in the whole-net thread, not here (the param ops are skip-agnostic — identical to the no-skip widenings).

                      def Proofs.EnetTiePoC.enetExpTied {N ic mid oc h w r kHd kWd : } (xN wN bN gN vN epsStr lrStr cotN : String) (εe : ) (hεe : 0 < εe) (εd : ) (hεd : 0 < εd) (εp : ) (hεp : 0 < εp) (We : Kernel4 mid ic 1 1) (be γe βe : Vec mid) (Wd : DepthwiseKernel mid kHd kWd) (bd γd βd : Vec mid) (Wz1 : Mat mid r) (bz1 : Vec r) (Wz2 : Mat r mid) (bz2 : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp γp βp : Vec oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :

                      Residual stride-1 MBConv block, tied. All 16 params (expand/project 1×1 conv W+b, depthwise W+b, SE reduce/excite dense W₁/b₁/W₂/b₂, three true-BN γ/β) denote the certified batched Σ_n loss-descent step at the real block forward activations + the chain cotangents driven by dyOut.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Proofs.EnetTiePoC.enet_exp_tied {N ic mid oc h w r kHd kWd : } (xN wN bN gN vN epsStr lrStr cotN : String) (εe : ) (hεe : 0 < εe) (εd : ) (hεd : 0 < εd) (εp : ) (hεp : 0 < εp) (We : Kernel4 mid ic 1 1) (be γe βe : Vec mid) (Wd : DepthwiseKernel mid kHd kWd) (bd γd βd : Vec mid) (Wz1 : Mat mid r) (bz1 : Vec r) (Wz2 : Mat r mid) (bz2 : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp γp βp : Vec oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                        enetExpTied xN wN bN gN vN epsStr lrStr cotN εe hεe εd hεd εp hεp We be γe βe Wd bd γd βd Wz1 bz1 Wz2 bz2 Wp bp γp βp xin dyOut lr

                        Strided downsampling MBConv block — all 16 params tied (b2/b4/b6/b12) #

                        Same as the expand block EXCEPT the expand stage lives at the block-input grid 2h×2w and the depthwise is strided (depthwiseStridedWeightSgdB, the expand-side cotangent cotEr upsamples h→2h via dStridedInB). No skip (spatial+channels change).

                        def Proofs.EnetTiePoC.enetStridedTied {N ic mid oc h w r kHd kWd : } (xN wN bN gN vN epsStr lrStr cotN : String) (εe : ) (hεe : 0 < εe) (εd : ) (hεd : 0 < εd) (εp : ) (hεp : 0 < εp) (We : Kernel4 mid ic 1 1) (be γe βe : Vec mid) (Wd : DepthwiseKernel mid kHd kWd) (bd γd βd : Vec mid) (Wz1 : Mat mid r) (bz1 : Vec r) (Wz2 : Mat r mid) (bz2 : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp γp βp : Vec oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :

                        Strided downsampling MBConv block, tied. All 16 params at the real forward (expand at 2h×2w, strided depthwise 2h→h) + the chain cotangents driven by dyOut.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Proofs.EnetTiePoC.enet_strided_tied {N ic mid oc h w r kHd kWd : } (xN wN bN gN vN epsStr lrStr cotN : String) (εe : ) (hεe : 0 < εe) (εd : ) (hεd : 0 < εd) (εp : ) (hεp : 0 < εp) (We : Kernel4 mid ic 1 1) (be γe βe : Vec mid) (Wd : DepthwiseKernel mid kHd kWd) (bd γd βd : Vec mid) (Wz1 : Mat mid r) (bz1 : Vec r) (Wz2 : Mat r mid) (bz2 : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp γp βp : Vec oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                          enetStridedTied xN wN bN gN vN epsStr lrStr cotN εe hεe εd hεd εp hεp We be γe βe Wd bd γd βd Wz1 bz1 Wz2 bz2 Wp bp γp βp xin dyOut lr

                          No-expand MBConv block (b1, t=1) — all 12 params tied (depthwise on ic → SE → project) #

                          NO expand conv: the depthwise runs directly on the block input (ic channels). 12 params (4 depthwise+BN, 4 SE, 4 project). The SE squeeze/excite is on ic channels (ic → r → ic).

                          def Proofs.EnetTiePoC.enetNoExpTied {N ic oc h w r kHd kWd : } (xN wN bN gN vN epsStr lrStr cotN : String) (εd : ) (hεd : 0 < εd) (εp : ) (hεp : 0 < εp) (Wd : DepthwiseKernel ic kHd kWd) (bd γd βd : Vec ic) (Wz1 : Mat ic r) (bz1 : Vec r) (Wz2 : Mat r ic) (bz2 : Vec ic) (Wp : Kernel4 oc ic 1 1) (bp γp βp : Vec oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :

                          No-expand MBConv block, tied. All 12 params at the real forward + chain cotangents.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Proofs.EnetTiePoC.enet_noexp_tied {N ic oc h w r kHd kWd : } (xN wN bN gN vN epsStr lrStr cotN : String) (εd : ) (hεd : 0 < εd) (εp : ) (hεp : 0 < εp) (Wd : DepthwiseKernel ic kHd kWd) (bd γd βd : Vec ic) (Wz1 : Mat ic r) (bz1 : Vec r) (Wz2 : Mat r ic) (bz2 : Vec ic) (Wp : Kernel4 oc ic 1 1) (bp γp βp : Vec oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                            enetNoExpTied xN wN bN gN vN epsStr lrStr cotN εd hεd εp hεp Wd bd γd βd Wz1 bz1 Wz2 bz2 Wp bp γp βp xin dyOut lr

                            Stem — the 3×3/s2 conv-bn-swish (4 params), feeding block 1 #

                            swish(bn(convStride2Xla Ws bs x)), 3→32 at 224→112, at the XLA-SAME phase the shipped stem uses. The cotangent block 1 delivers at the stem swish output (dyStem) lifts through swish-back

                            def Proofs.EnetTiePoC.enetStemTied {N ic oc h w kHs kWs : } (xN wN bN gN vN epsStr lrStr cotN : String) (εs : ) (hεs : 0 < εs) (Ws : Kernel4 oc ic kHs kWs) (bs γs βs : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (dyStem : Vec (N * (oc * h * w))) (lr : ) :

                            Stem, tied. The 3×3/s2 conv (Ws/bs) + its true-BN (γs/βs) at the real stem forward + the cotangent through the stem swish (no maxpool, no conv-back).

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              theorem Proofs.EnetTiePoC.enet_stem_tied {N ic oc h w kHs kWs : } (xN wN bN gN vN epsStr lrStr cotN : String) (εs : ) (hεs : 0 < εs) (Ws : Kernel4 oc ic kHs kWs) (bs γs βs : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (dyStem : Vec (N * (oc * h * w))) (lr : ) :
                              enetStemTied xN wN bN gN vN epsStr lrStr cotN εs hεs Ws bs γs βs x dyStem lr

                              Head — the 1×1 conv-bn-swish (4 params) → GAP → dense (Wfc/bfc), + the loss cotangent #

                              dense(GAP(swish(bn(conv Wh bh))))) (320→1280 conv, GAP, 1280→nClasses dense), then the batched per-row softmax-CE gradient g = rowSoftmax(logits) − onehot. The head conv params tie at the chain cotangent (loss → dense-back → GAP-back → swish/BN-back); the dense Wfc/bfc tie at the loss cotangent g directly.

                              def Proofs.EnetTiePoC.enetHeadTied {N c oc h w nC : } (xN wN bN gN vN epsStr lrStr cotN dN : String) (εh : ) (hεh : 0 < εh) (Wh : Kernel4 oc c 1 1) (bh γh βh : Vec oc) (Wfc : Mat oc nC) (bfc : Vec nC) (xhead : Vec (N * (c * h * w))) (onehot : Vec (N * nC)) (lr : ) :

                              Head, tied. The 4 head conv-bn params + the 2 dense params (Wfc/bfc) denote the certified step at the real head forward + the loss-driven cotangent g = rowSoftmax(logits) − onehot.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Proofs.EnetTiePoC.enet_head_tied {N c oc h w nC : } (xN wN bN gN vN epsStr lrStr cotN dN : String) (εh : ) (hεh : 0 < εh) (Wh : Kernel4 oc c 1 1) (bh γh βh : Vec oc) (Wfc : Mat oc nC) (bfc : Vec nC) (xhead : Vec (N * (c * h * w))) (onehot : Vec (N * nC)) (lr : ) :
                                enetHeadTied xN wN bN gN vN epsStr lrStr cotN dN εh hεh Wh bh γh βh Wfc bfc xhead onehot lr

                                @[irreducible] bundle-taking *TiedAt wrappers — one per block type, for the whole-net thread #

                                Each takes the B0Weights block bundle (MBW/MBWNoExp) + its ε-positivity + the block input + the downstream cotangent dyOut, and delegates to the per-block-type tie. @[irreducible] keeps the 16-deep capstone thread opaque to the elaborator (the r34/mnv2 heartbeat lesson).

                                @[irreducible]
                                def Proofs.EnetTiePoC.enetExpTiedAt (xN wN bN gN vN epsStr lrStr cotN : String) {N ic mid oc r kh kw : } (h w : ) (p : MBW ic mid oc r kh kw) (he : 0 < p.) (hd : 0 < p.) (hp : 0 < p.) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Proofs.EnetTiePoC.enet_exp_tiedAt (xN wN bN gN vN epsStr lrStr cotN : String) {N ic mid oc r kh kw : } (h w : ) (p : MBW ic mid oc r kh kw) (he : 0 < p.) (hd : 0 < p.) (hp : 0 < p.) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                                  enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN h w p he hd hp xin dyOut lr
                                  @[irreducible]
                                  def Proofs.EnetTiePoC.enetStridedTiedAt (xN wN bN gN vN epsStr lrStr cotN : String) {N ic mid oc r kh kw : } (h w : ) (p : MBW ic mid oc r kh kw) (he : 0 < p.) (hd : 0 < p.) (hp : 0 < p.) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem Proofs.EnetTiePoC.enet_strided_tiedAt (xN wN bN gN vN epsStr lrStr cotN : String) {N ic mid oc r kh kw : } (h w : ) (p : MBW ic mid oc r kh kw) (he : 0 < p.) (hd : 0 < p.) (hp : 0 < p.) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                                    enetStridedTiedAt xN wN bN gN vN epsStr lrStr cotN h w p he hd hp xin dyOut lr
                                    @[irreducible]
                                    def Proofs.EnetTiePoC.enetNoExpTiedAt (xN wN bN gN vN epsStr lrStr cotN : String) {N ic oc r kh kw : } (h w : ) (p : MBWNoExp ic oc r kh kw) (hd : 0 < p.) (hp : 0 < p.) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem Proofs.EnetTiePoC.enet_noexp_tiedAt (xN wN bN gN vN epsStr lrStr cotN : String) {N ic oc r kh kw : } (h w : ) (p : MBWNoExp ic oc r kh kw) (hd : 0 < p.) (hp : 0 < p.) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (lr : ) :
                                      enetNoExpTiedAt xN wN bN gN vN epsStr lrStr cotN h w p hd hp xin dyOut lr

                                      The whole-net thread — all 262 params tied through the REAL efficientnetForwardB_full #

                                      The capstone: efficientnetForwardB_full's prefixes are the block inputs (a0..a16 = stem, then the 16 MBConv blocks), and the per-block output cotangents (dy0..dy16) are composed TOP-DOWN by the proven block VJPs (headFwdB_has_vjp, mb{Exp,Resid,Strided,NoExp}W_has_vjp) from the loss cotangent g = rowSoftmax(logits) − onehot. Each block's tie then holds at its real input + threaded dyOut. The full §1a tie: the WHOLE 16-MBConv (262-param) EfficientNet-B0 train step is den-composed forward→loss→backward, no free activations, no symbolic cotangent. The residual fan-in at the 9 identity skips is folded into mbResidW's own VJP (it includes the + x), so it is automatic.

                                      theorem Proofs.EnetTiePoC.efficientnet_net_tied (xN wN bN gN vN epsStr lrStr cotN dN : String) (N : ) (w : B0Weights) (hsε : 0 < w.) (hb1d : 0 < w.b1.) (hb1p : 0 < w.b1.) (hb2e : 0 < w.b2.) (hb2d : 0 < w.b2.) (hb2p : 0 < w.b2.) (hb3e : 0 < w.b3.) (hb3d : 0 < w.b3.) (hb3p : 0 < w.b3.) (hb4e : 0 < w.b4.) (hb4d : 0 < w.b4.) (hb4p : 0 < w.b4.) (hb5e : 0 < w.b5.) (hb5d : 0 < w.b5.) (hb5p : 0 < w.b5.) (hb6e : 0 < w.b6.) (hb6d : 0 < w.b6.) (hb6p : 0 < w.b6.) (hb7e : 0 < w.b7.) (hb7d : 0 < w.b7.) (hb7p : 0 < w.b7.) (hb8e : 0 < w.b8.) (hb8d : 0 < w.b8.) (hb8p : 0 < w.b8.) (hb9e : 0 < w.b9.) (hb9d : 0 < w.b9.) (hb9p : 0 < w.b9.) (hb10e : 0 < w.b10.) (hb10d : 0 < w.b10.) (hb10p : 0 < w.b10.) (hb11e : 0 < w.b11.) (hb11d : 0 < w.b11.) (hb11p : 0 < w.b11.) (hb12e : 0 < w.b12.) (hb12d : 0 < w.b12.) (hb12p : 0 < w.b12.) (hb13e : 0 < w.b13.) (hb13d : 0 < w.b13.) (hb13p : 0 < w.b13.) (hb14e : 0 < w.b14.) (hb14d : 0 < w.b14.) (hb14p : 0 < w.b14.) (hb15e : 0 < w.b15.) (hb15d : 0 < w.b15.) (hb15p : 0 < w.b15.) (hb16e : 0 < w.b16.) (hb16d : 0 < w.b16.) (hb16p : 0 < w.b16.) (hhε : 0 < w.) (x : Vec (N * (3 * 224 * 224))) (onehot : Vec (N * 10)) (lr : ) :
                                      have a0 := stemB N w.sW w.sb w. w. w. x; have a1 := mbNoExpW N 112 112 w.b1 a0; have a2 := mbStridedW N 56 56 w.b2 a1; have a3 := mbResidW N 56 56 w.b3 a2; have a4 := mbStridedW N 28 28 w.b4 a3; have a5 := mbResidW N 28 28 w.b5 a4; have a6 := mbStridedW N 14 14 w.b6 a5; have a7 := mbResidW N 14 14 w.b7 a6; have a8 := mbResidW N 14 14 w.b8 a7; have a9 := mbExpW N 14 14 w.b9 a8; have a10 := mbResidW N 14 14 w.b10 a9; have a11 := mbResidW N 14 14 w.b11 a10; have a12 := mbStridedW N 7 7 w.b12 a11; have a13 := mbResidW N 7 7 w.b13 a12; have a14 := mbResidW N 7 7 w.b14 a13; have a15 := mbResidW N 7 7 w.b15 a14; have a16 := mbExpW N 7 7 w.b16 a15; have g := fun (idx : Fin (N * 10)) => StableHLO.rowSoftmaxFlat N 10 (headFwdB N w.hW w.hb w. w. w. w.fcW w.fcb a16) idx - onehot idx; have dy16 := (headFwdB_has_vjp N w.hW w.hb w. hhε w. w. w.fcW w.fcb).backward a16 g; have dy15 := (mbExpW_has_vjp N 7 7 w.b16 hb16e hb16d hb16p).backward a15 dy16; have dy14 := (mbResidW_has_vjp N 7 7 w.b15 hb15e hb15d hb15p).backward a14 dy15; have dy13 := (mbResidW_has_vjp N 7 7 w.b14 hb14e hb14d hb14p).backward a13 dy14; have dy12 := (mbResidW_has_vjp N 7 7 w.b13 hb13e hb13d hb13p).backward a12 dy13; have dy11 := (mbStridedW_has_vjp N 7 7 w.b12 hb12e hb12d hb12p).backward a11 dy12; have dy10 := (mbResidW_has_vjp N 14 14 w.b11 hb11e hb11d hb11p).backward a10 dy11; have dy9 := (mbResidW_has_vjp N 14 14 w.b10 hb10e hb10d hb10p).backward a9 dy10; have dy8 := (mbExpW_has_vjp N 14 14 w.b9 hb9e hb9d hb9p).backward a8 dy9; have dy7 := (mbResidW_has_vjp N 14 14 w.b8 hb8e hb8d hb8p).backward a7 dy8; have dy6 := (mbResidW_has_vjp N 14 14 w.b7 hb7e hb7d hb7p).backward a6 dy7; have dy5 := (mbStridedW_has_vjp N 14 14 w.b6 hb6e hb6d hb6p).backward a5 dy6; have dy4 := (mbResidW_has_vjp N 28 28 w.b5 hb5e hb5d hb5p).backward a4 dy5; have dy3 := (mbStridedW_has_vjp N 28 28 w.b4 hb4e hb4d hb4p).backward a3 dy4; have dy2 := (mbResidW_has_vjp N 56 56 w.b3 hb3e hb3d hb3p).backward a2 dy3; have dy1 := (mbStridedW_has_vjp N 56 56 w.b2 hb2e hb2d hb2p).backward a1 dy2; have dy0 := (mbNoExpW_has_vjp N 112 112 w.b1 hb1d hb1p).backward a0 dy1; enetStemTied xN wN bN gN vN epsStr lrStr cotN w. hsε w.sW w.sb w. w. x dy0 lr enetNoExpTiedAt xN wN bN gN vN epsStr lrStr cotN 112 112 w.b1 hb1d hb1p a0 dy1 lr enetStridedTiedAt xN wN bN gN vN epsStr lrStr cotN 56 56 w.b2 hb2e hb2d hb2p a1 dy2 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 56 56 w.b3 hb3e hb3d hb3p a2 dy3 lr enetStridedTiedAt xN wN bN gN vN epsStr lrStr cotN 28 28 w.b4 hb4e hb4d hb4p a3 dy4 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 28 28 w.b5 hb5e hb5d hb5p a4 dy5 lr enetStridedTiedAt xN wN bN gN vN epsStr lrStr cotN 14 14 w.b6 hb6e hb6d hb6p a5 dy6 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 14 14 w.b7 hb7e hb7d hb7p a6 dy7 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 14 14 w.b8 hb8e hb8d hb8p a7 dy8 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 14 14 w.b9 hb9e hb9d hb9p a8 dy9 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 14 14 w.b10 hb10e hb10d hb10p a9 dy10 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 14 14 w.b11 hb11e hb11d hb11p a10 dy11 lr enetStridedTiedAt xN wN bN gN vN epsStr lrStr cotN 7 7 w.b12 hb12e hb12d hb12p a11 dy12 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 7 7 w.b13 hb13e hb13d hb13p a12 dy13 lr enetExpTiedAt xN wN bN gN vN epsStr lrStr cotN 7 7 w.b14 hb14e hb14d hb14p a13 dy14 lr

                                      The whole 16-MBConv EfficientNet-B0 train step, tied. Threading the real batched (true-BN + SE) forward efficientnetForwardB_full and the loss-driven backward cotangent chain (swish masks, SE gate fan-in, true-BN backs, the residual fan-in folded into the block VJPs), the stem, all 16 MBConv blocks, the conv-bn-swish head, and the dense head all denote the certified batched Σ_n loss-descent step.