The stride-1 depthwise param updates, proof-tied to the certified SGD step #
The two stride-1 depthwise{Weight,Bias}Sgd ops (StableHLO.lean) each denote the certified
loss-descent step θ − lr·(certified ∂/∂θ · c), generic in the cotangent c the backward chain
delivers — the depthwise peers of CifarPoC.convW_den/convB_den, delegating to the
mnv2_render_depthwise*_certified bridges (MobileNetV2Close.lean). Written for MobileNetV2's
per-example fold; ConvNeXt-T's 7×7 depthwise ties (ConvNeXtStepTie) are what use them now.
depthwiseB_den delegates to mnv2_render_depthwiseb_certified. The weight is the one needing a
bridge: the stride-1 depthwise weight VJP is 3-index (depthwise_weight_grad_has_vjp3), and the
emitted op's den carries it flat (Tensor3.flatten (… .backward W (unflatten c))), so
depthwiseW_den first routes through mnv2_render_depthwiseW_flat_certified — the flat
pdiv-Jacobian form via hasVJP3_to_hasVJP.correct, modulo the unflatten ∘ flatten = id
round-trip on W.
Honest residual #
- The cotangents
care free (∀ c); pinning each to the actual backward chain is the §1a tie. Per-opprettylexing + ℝ → Float32.
Flat stride-1 depthwise weight render bridge. The emitted op's flat weight grad
flatten W − lr·flatten((dwconv_weight_grad₃ b x).backward W (unflatten c)) equals the flat
pdiv-Jacobian form. Via hasVJP3_to_hasVJP.correct (the triple→flat reindex), modulo
unflatten (flatten W) = W. The stride-1 depthwise peer of cnn_render_convW_certified.
Stride-1 depthwise weight op = certified. The depthwiseWeightSgd op denotes
flatten W − lr·(certified ∂(depthwiseConv2d)/∂W · c) (flat pdiv form). The stride-1 depthwise
peer of CifarPoC.convW_den.
Stride-1 depthwise bias op = certified. Delegates to mnv2_render_depthwiseb_certified.