MobileNetV2 — every parameter gradient node IS the loss's derivative in that parameter #
mnv2_net_tiedB says each of the 210 parameter gradient nodes (158 emitted at the default
convBias := false) denotes its layer's parameter Jacobian contracted with the cotangent the
emitted backward chain threads to it, from a loss cotangent g; the *_eq_vjp lemmas say the
chain's segments are certified VJP backwards. mnv2_net_lossGrad composes them: for any loss L
of the logits whose gradient at the net's output is g, every node is ∂L/∂θ of the WHOLE net with
that one parameter varied. mnv2_net_lossGrad_smoothedCE discharges hL for the label-smoothed
loss the artifacts ship.
Scope. One replica, at either precision: every conv and depthwise weight node is stated on
the renderers' switch (convWeightGradBAt bf16 id …, depthwiseWeightGradBAt bf16 id …, …;
Foundation.GradNodesBAt), so bf16 := true is the bf16 kind the mobilenetv2*bf16 artifacts
emit — mobilenetv2in_rmsdp64wxdols0eps0001bf16, the book's ImageNet run, among them — read over ℝ
at the identity rounding (Bf16Erasure), and bf16 := false the f32 artifacts'. Classifier
dropout is an optional site on the statement, as in MobileNetV2StepTieB: cd : Option (Vec (N * 1280)), none the drop-free artifacts and some m the *do* ones, the loss read at
mobilenetv2ForwardBFullDoOpt (the net with the site), the dense weight node reading the dropped
activation and the chain above the site pulled back through the mask (dropoutOptHasVJP).
Sync-BN data parallelism is reached by composition: mnv2_net_syncTiedB says each all-reduced
gradient is this net's tied node at N := R·N, which this file's capstone makes the loss's
gradient at the global batch.
How. ResNet50ParamGrad's shape:
- Per stage (at variable widths): the loss read at the output of the stem, the
t = 1block, the stride-1 body, the stride-2 body and the head, pulled back one stage at a time byParamGradNodes' pull-backs (relu6'shasGradAt_relu6, batch BN, the conv and depthwise input-VJPs, the XLA-SAMEstrided depthwise'shasGradAt_depthwiseStridedXlaamong them), so each internal activation's gradient is the chain's own cotangent. The stride-1 body bundle covers both the skip blocks and the two widenings: a skip block's body sees the lossu ↦ Gn (u + v), whose gradient at the body output is stilldyOut(mnv2_resid_lossTiedB). - Per net: the loss read after each block (
mnv2Suf*), pulled back through the seventeen certified block VJPs and the head's, and eachΦidentified with the whole net at updated weights by a standalonemnv2_factor_*theorem.
Hypotheses. MNV2PosB (every BN ε > 0), MNV2SmoothAtB (all 35 relu6 sites off both kinks
at the real activations); for the smoothed loss every example's target summing to one and
0 < nCls.
Stem, every parameter node a loss derivative — the four nodes mnv2StemTiedB ties, Φ the
loss as a function of the stem's (W, b, γ, β).
Equations
- One or more equations did not get rendered due to their size.
Instances For
t = 1 block, every parameter node a loss derivative — the eight nodes mnv2NoExpTiedB
ties. The project BN's γ/β read dyOut itself: nothing follows the linear bottleneck.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stride-1 body, every parameter node a loss derivative — the twelve nodes
mnv2Stride1TiedB ties, Φ the loss at the body output as a function of the weight record.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The stride-1 body bundle, from the loss Gb at the body output. A widening block (b11,
b17) is this at Gb := Gn.
A skip block's twelve nodes. The identity skip is a constant once a body parameter varies,
so the loss at the body output has gradient dyOut there and the body bundle applies.
Stride-2 block, every parameter node a loss derivative — the twelve nodes
mnv2Stride2TiedB ties; the depthwise nodes are the XLA-SAME strided ones.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Head, every parameter node a loss derivative — the six nodes mnv2HeadTiedB ties, Φ
the loss as a function of (hW, hb, hγ, hβ, Wd, bd).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pull the loss gradient back through the t = 1 block (mnv2NoExpCotIn_eq_vjp).
…through a widening block (mnv2ExpOnlyCotIn_eq_vjp).
…through a skip block (mnv2ResidCotIn_eq_vjp).
…and through a stride-2 block (mnv2StridedCotIn_eq_vjp).
The net after block b17 — the head.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB17 N w cd = Proofs.MobileNetV2TieB.mnv2HeadBDoOpt N 7 7 w.hW w.hb w.hε w.hγ w.hβ w.fcW w.fcb cd
Instances For
The net after block b16: block b17, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB16 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB17 N w cd (Proofs.mnv2ExpOnlyB N 7 7 w.b17 y)
Instances For
The net after block b15: block b16, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB15 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB16 N w cd (Proofs.mnv2ResidB N 7 7 w.b16 y)
Instances For
The net after block b14: block b15, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB14 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB15 N w cd (Proofs.mnv2ResidB N 7 7 w.b15 y)
Instances For
The net after block b13: block b14, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB13 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB14 N w cd (Proofs.mnv2StridedB N 7 7 w.b14 y)
Instances For
The net after block b12: block b13, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB12 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB13 N w cd (Proofs.mnv2ResidB N 14 14 w.b13 y)
Instances For
The net after block b11: block b12, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB11 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB12 N w cd (Proofs.mnv2ResidB N 14 14 w.b12 y)
Instances For
The net after block b10: block b11, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB10 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB11 N w cd (Proofs.mnv2ExpOnlyB N 14 14 w.b11 y)
Instances For
The net after block b9: block b10, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB9 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB10 N w cd (Proofs.mnv2ResidB N 14 14 w.b10 y)
Instances For
The net after block b8: block b9, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB8 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB9 N w cd (Proofs.mnv2ResidB N 14 14 w.b9 y)
Instances For
The net after block b7: block b8, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB7 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB8 N w cd (Proofs.mnv2ResidB N 14 14 w.b8 y)
Instances For
The net after block b6: block b7, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB6 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB7 N w cd (Proofs.mnv2StridedB N 14 14 w.b7 y)
Instances For
The net after block b5: block b6, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB5 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB6 N w cd (Proofs.mnv2ResidB N 28 28 w.b6 y)
Instances For
The net after block b4: block b5, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB4 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB5 N w cd (Proofs.mnv2ResidB N 28 28 w.b5 y)
Instances For
The net after block b3: block b4, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB3 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB4 N w cd (Proofs.mnv2StridedB N 28 28 w.b4 y)
Instances For
The net after block b2: block b3, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB2 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB3 N w cd (Proofs.mnv2ResidB N 56 56 w.b3 y)
Instances For
The net after block b1: block b2, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufB1 N w cd y = Proofs.MobileNetV2TieB.mnv2SufB2 N w cd (Proofs.mnv2StridedB N 56 56 w.b2 y)
Instances For
The net after the stem: block b1, then the rest.
Equations
- Proofs.MobileNetV2TieB.mnv2SufStem N w cd y = Proofs.MobileNetV2TieB.mnv2SufB1 N w cd (Proofs.mnv2NoExpB N 112 112 w.b1 y)
Instances For
The net with the stem's parameters varied is the suffix after the stem at the varied stem.
The net with block b1's weights varied is the suffix after b1 at the varied block.
The net with block b2's weights varied is the suffix after b2 at the varied block.
The net with block b3's weights varied is the suffix after b3 at the varied block.
The net with block b4's weights varied is the suffix after b4 at the varied block.
The net with block b5's weights varied is the suffix after b5 at the varied block.
The net with block b6's weights varied is the suffix after b6 at the varied block.
The net with block b7's weights varied is the suffix after b7 at the varied block.
The net with block b8's weights varied is the suffix after b8 at the varied block.
The net with block b9's weights varied is the suffix after b9 at the varied block.
The net with block b10's weights varied is the suffix after b10 at the varied block.
The net with block b11's weights varied is the suffix after b11 at the varied block.
The net with block b12's weights varied is the suffix after b12 at the varied block.
The net with block b13's weights varied is the suffix after b13 at the varied block.
The net with block b14's weights varied is the suffix after b14 at the varied block.
The net with block b15's weights varied is the suffix after b15 at the varied block.
The net with block b16's weights varied is the suffix after b16 at the varied block.
The net with block b17's weights varied is the suffix after b17 at the varied block.
The net with the head varied is the head at the varied parameters.
Every MobileNetV2 parameter gradient node is the derivative of L in that parameter, for a
loss L of the logits and g the cotangent the chain starts from: the 210 slots
mnv2_net_tiedB ties, each at the cotangent the emitted chain threads to it, stated against L
of mobilenetv2ForwardBFull with that one parameter varied.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every MobileNetV2 parameter gradient node is the derivative of the loss in that
parameter. For any loss L of the logits with gradient g at the net's output, each of the
210 slots mnv2_net_tiedB ties — at the same cotangent — is ∂L/∂θ of the WHOLE net,
mobilenetv2ForwardBFull with that one parameter varied (a stem field, a block's weight record
w.bk := p with one slot changed, or a head field).
Hypotheses: every BN ε positive (MNV2PosB) and all 35 relu6 sites off both kinks at the real
activations (MNV2SmoothAtB). The loss enters only through hL;
mnv2_net_lossGrad_smoothedCE discharges it for the loss the artifacts ship.
One replica; bf16 selects the conv and depthwise weight nodes' kind (the module's Scope).
The loss the artifacts ship: every node is the derivative of the batched label-smoothed
cross-entropy smoothedBatchLoss, g the six-op cotangent the render emits.
The emitted MobileNetV2 step's gradient nodes ARE the loss's gradient, at one chain. For
each of the 210 parameter slots, at ONE cotangent chain (the tie's own, from g): the node
denotes its layer's Jacobian against the chain cotangent (mnv2_net_tiedB), and any loss L of
the logits with gradient g at the network's output of mobilenetv2ForwardBFull with that one
slot varied is differentiable there with the node as its gradient (mnv2_net_lossGrad). The two
theorems each state the chain; this one states it once, so an edit to either chain breaks its
proof.