The linear train step descends the certified softmax-CE gradient #
StableHLO.Basic proves the Chapter-1 linear train step piecewise: the forward
graph (fwdGraph_faithful), the loss cotangent (lossCotGraph_isCEgrad), the
per-parameter Jacobians (wGrad/bGrad_isWeightJacobian), and the plain-SGD update
(sgdW/sgdB_isCertifiedGradStep). Each of those, however, still mentions the
emitted cotangent as den (lossCotGraph …) — a denotation of an emitted graph,
not a named closed form.
This file bundles them into a single statement per parameter: the emitted SGD
update subtracts lr times [the certified ∂logits/∂θ Jacobian] contracted with
[the certified closed-form softmax-CE gradient softmax − onehot]. Every factor
is a named, axiom-audited certified quantity — no residual den-of-graph, no
trusted optimizer step. This is the denotation half for linear
(what the emitted train step computes), for one example x.
The chain-rule fold is here too: by pdiv_comp, the two-factor sum is the single
gradient ∂/∂θ (crossEntropy ∘ mnistLinear) (lossWeightGrad_eq_sum, in SmoothedLossCot with
the other loss-cotangent lemmas), so the weight update is literally one step of gradient descent on
the loss (sgdW_descends_loss_gradient, using crossEntropy_differentiable). The rendering half — that the emitted text is pretty
of these graphs — is linTrainStepText and LinearFold.
Weight update. The emitted linear SGD weight update subtracts lr times the
certified ∂logits/∂W Jacobian contracted with the certified closed-form
softmax-CE gradient softmax − onehot.
The softmax-CE loss is differentiable in the (flattened) weights.
Weight update, folded. The emitted linear SGD weight update is literally
one step of gradient descent on the certified softmax-CE loss:
W − lr·∂(crossEntropy ∘ mnistLinear)/∂W.
The two outputs' ℝ denotations: the flattened certified weight update and
the certified bias update.
Equations
- Proofs.StableHLO.linWeightDen W b x lr label = (Proofs.StableHLO.sgdW W b x lr label).flatten
Instances For
Equations
- Proofs.StableHLO.linBiasDen W b x lr label = Proofs.StableHLO.sgdB W b x lr label
Instances For
Faithfulness, output 0 (weights). The rendered weight output denotes
literally W − lr·∂(softmax-CE loss)/∂W (sgdW_descends_loss_gradient).