ResNet-50 — every parameter gradient node IS the loss's derivative in that parameter #
r50_net_tiedB says each of the 161 parameter gradient nodes denotes its layer's parameter
Jacobian contracted with the cotangent the emitted backward chain threads to it, from a loss
cotangent g it takes as a binder; the r50*CotIn_eq_vjp lemmas say the block-input cotangents
are certified VJP backwards. r50_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. The two losses the artifacts ship discharge hL:
r50_net_lossGrad_smoothedCE— thebce := falseartifacts:L = smoothedBatchLoss,gthe six-op label-smoothed chain (smoothedBatchLoss_grad).r50_net_lossGrad_bce— thebce := trueartifacts,resnet50in160_lambaccdp8x64bceamong them:L = bceBatchLoss, the mean overB×K,gthe three-op chain (bceBatchLoss_grad).
How. ResNet34ParamGrad's three layers, with R34's stem and head bundles reused verbatim (the
stem and head ARE R34's functions at R50's widths):
- Per block kind (at variable widths): the loss read at each internal activation of an
identity / stride-1 projection / strided projection bottleneck (
r50IdG*,r50ProjG*,r50DownG*), its gradient the chain's own cotangent, pulled back one certified stage at a time. The bundlesr50IdLossTiedB/r50ProjLossTiedB/r50DownLossTiedBstate the block's nodes againstΦ, the loss as a function of the block's weight record — the same slots asr50IdTiedB/r50ProjTiedB/r50DownTiedB, no conv bias (ResNet50RenderBemits none). - Per net: the loss read after each block (
r50Suf*), its gradient pulled back through the sixteen certified bottleneck VJPs, andΦidentified with the whole net at updated weights (r50_factor_*), each a standalone theorem.
Hypotheses. 0 < q, R50PosB (every BN ε > 0), R50SmoothAtB (every relu off its kink and
the stem pool tie-free at the real activations); for the smoothed loss also every example's target
summing to one and 0 < nCls. The BCE corollary takes no hypothesis on the target.
The loss at bn₃'s output (the skip v held fixed).
Equations
- Proofs.ResNet50TieB.r50IdGN3 N h w Gn v u = Proofs.ResNet50TieB.r50IdGA N h w Gn fun (i : Fin (N * (oc * h * w))) => u i + v i
Instances For
The loss at conv₃'s output.
Equations
- Proofs.ResNet50TieB.r50IdGC3 N h w Gn p v z = Proofs.ResNet50TieB.r50IdGN3 N h w Gn v (Proofs.StableHLO.bnBatchLA N oc h w p.ε₃ p.γ₃ p.β₃ z)
Instances For
The loss at bn₂'s output.
Equations
- Proofs.ResNet50TieB.r50IdGN2 N h w Gn p v u = Proofs.ResNet50TieB.r50IdGC3 N h w Gn p v (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₃ p.b₃) (Proofs.relu (N * (mid * h * w)) u))
Instances For
The loss at conv₂'s output.
Equations
- Proofs.ResNet50TieB.r50IdGC2 N h w Gn p v z = Proofs.ResNet50TieB.r50IdGN2 N h w Gn p v (Proofs.StableHLO.bnBatchLA N mid h w p.ε₂ p.γ₂ p.β₂ z)
Instances For
The loss at bn₁'s output.
Equations
- Proofs.ResNet50TieB.r50IdGN1 N h w Gn p v u = Proofs.ResNet50TieB.r50IdGC2 N h w Gn p v (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₂ p.b₂) (Proofs.relu (N * (mid * h * w)) u))
Instances For
The loss at conv₁'s output.
Equations
- Proofs.ResNet50TieB.r50IdGC1 N h w Gn p v z = Proofs.ResNet50TieB.r50IdGN1 N h w Gn p v (Proofs.StableHLO.bnBatchLA N mid h w p.ε₁ p.γ₁ p.β₁ z)
Instances For
Identity bottleneck, every parameter node a loss derivative. With Gn the loss read at
the block's output and Φ the loss as a function of the block's weight record (hΦ), each of
the nine nodes r50IdTiedB ties — at the same cotangents — is ∂Φ/∂slot with that one slot
varied.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The projection branch's output, bnₚ(convₚ v).
Equations
- Proofs.ResNet50TieB.r50ProjProjOut N h w p v = Proofs.projB N p.Wp p.bp p.εp p.γp p.βp v
Instances For
The body branch's output, bn₃(conv₃(relu(bn₂(conv₂(relu(bn₁(conv₁ v))))))).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The loss at bn₃'s output (projection branch fixed, on the left).
Equations
- Proofs.ResNet50TieB.r50ProjGN3 N h w Gn p v u = Proofs.ResNet50TieB.r50IdGA N h w Gn fun (i : Fin (N * (oc * h * w))) => Proofs.ResNet50TieB.r50ProjProjOut N h w p v i + u i
Instances For
Equations
- Proofs.ResNet50TieB.r50ProjGC3 N h w Gn p v z = Proofs.ResNet50TieB.r50ProjGN3 N h w Gn p v (Proofs.StableHLO.bnBatchLA N oc h w p.ε₃ p.γ₃ p.β₃ z)
Instances For
Equations
- Proofs.ResNet50TieB.r50ProjGN2 N h w Gn p v u = Proofs.ResNet50TieB.r50ProjGC3 N h w Gn p v (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₃ p.b₃) (Proofs.relu (N * (mid * h * w)) u))
Instances For
Equations
- Proofs.ResNet50TieB.r50ProjGC2 N h w Gn p v z = Proofs.ResNet50TieB.r50ProjGN2 N h w Gn p v (Proofs.StableHLO.bnBatchLA N mid h w p.ε₂ p.γ₂ p.β₂ z)
Instances For
Equations
- Proofs.ResNet50TieB.r50ProjGN1 N h w Gn p v u = Proofs.ResNet50TieB.r50ProjGC2 N h w Gn p v (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₂ p.b₂) (Proofs.relu (N * (mid * h * w)) u))
Instances For
Equations
- Proofs.ResNet50TieB.r50ProjGC1 N h w Gn p v z = Proofs.ResNet50TieB.r50ProjGN1 N h w Gn p v (Proofs.StableHLO.bnBatchLA N mid h w p.ε₁ p.γ₁ p.β₁ z)
Instances For
The loss at bnₚ's output (body branch fixed, on the right).
Equations
- Proofs.ResNet50TieB.r50ProjGNp N h w Gn p v u = Proofs.ResNet50TieB.r50IdGA N h w Gn fun (i : Fin (N * (oc * h * w))) => u i + Proofs.ResNet50TieB.r50ProjBodyOut N h w p v i
Instances For
Equations
- Proofs.ResNet50TieB.r50ProjGCp N h w Gn p v z = Proofs.ResNet50TieB.r50ProjGNp N h w Gn p v (Proofs.StableHLO.bnBatchLA N oc h w p.εp p.γp p.βp z)
Instances For
Stride-1 projection bottleneck, every parameter node a loss derivative — the twelve nodes
r50ProjTiedB ties.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The strided projection branch's output.
Equations
- Proofs.ResNet50TieB.r50DownProjOut N h w p v = Proofs.StableHLO.projStridedB N p.Wp p.bp p.εp p.γp p.βp v
Instances For
Equations
- Proofs.ResNet50TieB.r50DownGN3 N h w Gn p v u = Proofs.ResNet50TieB.r50IdGA N h w Gn fun (i : Fin (N * (oc * h * w))) => Proofs.ResNet50TieB.r50DownProjOut N h w p v i + u i
Instances For
Equations
- Proofs.ResNet50TieB.r50DownGC3 N h w Gn p v z = Proofs.ResNet50TieB.r50DownGN3 N h w Gn p v (Proofs.StableHLO.bnBatchLA N oc h w p.ε₃ p.γ₃ p.β₃ z)
Instances For
Equations
- Proofs.ResNet50TieB.r50DownGN2 N h w Gn p v u = Proofs.ResNet50TieB.r50DownGC3 N h w Gn p v (Proofs.StableHLO.batchMap N (Proofs.flatConv p.W₃ p.b₃) (Proofs.relu (N * (mid * h * w)) u))
Instances For
Equations
- Proofs.ResNet50TieB.r50DownGC2 N h w Gn p v z = Proofs.ResNet50TieB.r50DownGN2 N h w Gn p v (Proofs.StableHLO.bnBatchLA N mid h w p.ε₂ p.γ₂ p.β₂ z)
Instances For
The loss at bn₁'s output, at the input grid 2h × 2w.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Proofs.ResNet50TieB.r50DownGC1 N h w Gn p v z = Proofs.ResNet50TieB.r50DownGN1 N h w Gn p v (Proofs.StableHLO.bnBatchLA N mid (2 * h) (2 * w) p.ε₁ p.γ₁ p.β₁ z)
Instances For
Equations
- Proofs.ResNet50TieB.r50DownGNp N h w Gn p v u = Proofs.ResNet50TieB.r50IdGA N h w Gn fun (i : Fin (N * (oc * h * w))) => u i + Proofs.ResNet50TieB.r50DownBodyOut N h w p v i
Instances For
Equations
- Proofs.ResNet50TieB.r50DownGCp N h w Gn p v z = Proofs.ResNet50TieB.r50DownGNp N h w Gn p v (Proofs.StableHLO.bnBatchLA N oc h w p.εp p.γp p.βp z)
Instances For
Strided projection bottleneck, every parameter node a loss derivative — the twelve nodes
r50DownTiedB ties: W₁ an ordinary conv node at 2h × 2w, W₂ and Wp strided.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pull the loss gradient back through an identity bottleneck: the certified block VJP, read at
the chain's own fan-in (r50IdCotIn_eq_vjp).
…through the stride-1 projection bottleneck (r50ProjCotIn_eq_vjp).
…and through the strided projection bottleneck (r50DownCotIn_eq_vjp).
The net after block s4b2 — the head.
Equations
- Proofs.ResNet50TieB.r50SufS4b2 N q w = Proofs.r34HeadB N q q w.Wd w.bd
Instances For
The net after block s4b1: block s4b2, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS4b1 N q w y = Proofs.ResNet50TieB.r50SufS4b2 N q w (Proofs.r50IdB N q q w.s4b2 y)
Instances For
The net after block s4b0: block s4b1, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS4b0 N q w y = Proofs.ResNet50TieB.r50SufS4b1 N q w (Proofs.r50IdB N q q w.s4b1 y)
Instances For
The net after block s3b5: block s4b0, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS3b5 N q w y = Proofs.ResNet50TieB.r50SufS4b0 N q w (Proofs.r50DownB N q q w.s4b0 y)
Instances For
The net after block s3b4: block s3b5, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS3b4 N q w y = Proofs.ResNet50TieB.r50SufS3b5 N q w (Proofs.r50IdB N (2 * q) (2 * q) w.s3b5 y)
Instances For
The net after block s3b3: block s3b4, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS3b3 N q w y = Proofs.ResNet50TieB.r50SufS3b4 N q w (Proofs.r50IdB N (2 * q) (2 * q) w.s3b4 y)
Instances For
The net after block s3b2: block s3b3, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS3b2 N q w y = Proofs.ResNet50TieB.r50SufS3b3 N q w (Proofs.r50IdB N (2 * q) (2 * q) w.s3b3 y)
Instances For
The net after block s3b1: block s3b2, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS3b1 N q w y = Proofs.ResNet50TieB.r50SufS3b2 N q w (Proofs.r50IdB N (2 * q) (2 * q) w.s3b2 y)
Instances For
The net after block s3b0: block s3b1, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS3b0 N q w y = Proofs.ResNet50TieB.r50SufS3b1 N q w (Proofs.r50IdB N (2 * q) (2 * q) w.s3b1 y)
Instances For
The net after block s2b3: block s3b0, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS2b3 N q w y = Proofs.ResNet50TieB.r50SufS3b0 N q w (Proofs.r50DownB N (2 * q) (2 * q) w.s3b0 y)
Instances For
The net after block s2b2: block s2b3, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS2b2 N q w y = Proofs.ResNet50TieB.r50SufS2b3 N q w (Proofs.r50IdB N (2 * (2 * q)) (2 * (2 * q)) w.s2b3 y)
Instances For
The net after block s2b1: block s2b2, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS2b1 N q w y = Proofs.ResNet50TieB.r50SufS2b2 N q w (Proofs.r50IdB N (2 * (2 * q)) (2 * (2 * q)) w.s2b2 y)
Instances For
The net after block s2b0: block s2b1, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS2b0 N q w y = Proofs.ResNet50TieB.r50SufS2b1 N q w (Proofs.r50IdB N (2 * (2 * q)) (2 * (2 * q)) w.s2b1 y)
Instances For
The net after block s1b2: block s2b0, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS1b2 N q w y = Proofs.ResNet50TieB.r50SufS2b0 N q w (Proofs.r50DownB N (2 * (2 * q)) (2 * (2 * q)) w.s2b0 y)
Instances For
The net after block s1b1: block s1b2, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS1b1 N q w y = Proofs.ResNet50TieB.r50SufS1b2 N q w (Proofs.r50IdB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b2 y)
Instances For
The net after block s1b0: block s1b1, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufS1b0 N q w y = Proofs.ResNet50TieB.r50SufS1b1 N q w (Proofs.r50IdB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b1 y)
Instances For
The net after the stem: block s1b0, then the rest.
Equations
- Proofs.ResNet50TieB.r50SufStem N q w y = Proofs.ResNet50TieB.r50SufS1b0 N q w (Proofs.r50ProjB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b0 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 s1b0's weights varied is the suffix after s1b0 at the varied block.
The net with block s1b1's weights varied is the suffix after s1b1 at the varied block.
The net with block s1b2's weights varied is the suffix after s1b2 at the varied block.
The net with block s2b0's weights varied is the suffix after s2b0 at the varied block.
The net with block s2b1's weights varied is the suffix after s2b1 at the varied block.
The net with block s2b2's weights varied is the suffix after s2b2 at the varied block.
The net with block s2b3's weights varied is the suffix after s2b3 at the varied block.
The net with block s3b0's weights varied is the suffix after s3b0 at the varied block.
The net with block s3b1's weights varied is the suffix after s3b1 at the varied block.
The net with block s3b2's weights varied is the suffix after s3b2 at the varied block.
The net with block s3b3's weights varied is the suffix after s3b3 at the varied block.
The net with block s3b4's weights varied is the suffix after s3b4 at the varied block.
The net with block s3b5's weights varied is the suffix after s3b5 at the varied block.
The net with block s4b0's weights varied is the suffix after s4b0 at the varied block.
The net with block s4b1's weights varied is the suffix after s4b1 at the varied block.
The net with block s4b2's weights varied is the suffix after s4b2 at the varied block.
The net with the classifier varied is the head at the varied classifier.
Every ResNet-50 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 161 nodes
r50_net_tiedB ties, each at the cotangent the emitted chain threads to it, stated against L
of resnet50ForwardBFull with that one parameter varied. r50_net_lossGrad proves it whenever
g is L's gradient at the logits; the two losses the artifacts ship instantiate it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every ResNet-50 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 161 nodes
r50_net_tiedB ties — at the same cotangent — is ∂L/∂θ of the WHOLE net, resnet50ForwardBFull
with that one parameter varied (a stem field, a block's weight record w.blk := p with one slot
changed, or the classifier).
Hypotheses: 0 < q, every BN ε positive (R50PosB), every relu off its kink and the stem
pool tie-free at the real activations (R50SmoothAtB). The loss enters only through hL;
r50_net_lossGrad_smoothedCE and r50_net_lossGrad_bce discharge it for the two losses the
artifacts ship.
The bce := false artifacts: every node is the derivative of the batched label-smoothed
cross-entropy smoothedBatchLoss, g the six-op cotangent the render emits.
The bce := true artifacts (resnet50in160_lambaccdp8x64bce among them): every node is
the derivative of the batched BCE-with-logits bceBatchLoss, the mean over B×K, g the
three-op cotangent at the committed divisor N·K. No hypothesis on the target.