The 8-conv CIFAR CNN — every gradient node IS the loss's derivative, up to pool twins #
cifar8_train_step_tiedG states the 22 un-fused gradient nodes the packed cifar8w_* arms emit,
each at the cotangent the chain threads to it. cifar8_net_lossGrad states that each node, at the
chain cotangent, is the gradient of the loss in that parameter, for any loss L of the logits with
gradient g there; cifar8_net_lossGrad_CE instantiates it at the softmax cross-entropy the
render emits.
The four pools are handled as the 2-stage net's two (CifarFold.cifar_net_lossGrad): each pool's
clause allows ties between twins, cells equal at every weight upstream of that pool
(CnnFold.CnnPoolTwin, Cifar8PoolTwin2, Cifar8PoolTwin3, Cifar8PoolTwin4), and each pool's
backward routes a window's cotangent to the one cell a selection names, as the rendered
select_and_scatter does. A stage-s parameter sees pools s…4 move; its germ rewrites them
outermost first, at the true pre-activations (germ4 … germ1 in the proof). cifar8Up is the
step between two pools' pre-activations.
Hypotheses. Odd kernels, every ReLU off its kink, every pool window dead or tied only between
twins, each selection naming a maximum of every window (Cifar8LossSmoothAt).
Scope. One example (the emitted module batch-contracts; den is per-example).
From one pool's pre-activation to the next pool's: ReLU, pool, conv, ReLU, conv.
Equations
- Proofs.Cifar8TieG.cifar8Up Wc bc Wd bd z = Proofs.flatConv Wd bd (Proofs.relu (c' * H * W) (Proofs.flatConv Wc bc (Proofs.maxPoolFlat c H W (Proofs.relu (c * (2 * H) * (2 * W)) z))))
Instances For
The second pool's pre-activation (conv₄'s output).
Equations
- Proofs.Cifar8TieG.cifar8Pre2 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ x = Proofs.Cifar8TieG.cifar8Up W₃ b₃ W₄ b₄ (Proofs.CnnFold.cnnPoolPre W₁ b₁ W₂ b₂ x)
Instances For
The third pool's pre-activation (conv₆'s output).
Equations
- Proofs.Cifar8TieG.cifar8Pre3 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ x = Proofs.Cifar8TieG.cifar8Up W₅ b₅ W₆ b₆ (Proofs.Cifar8TieG.cifar8Pre2 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ x)
Instances For
The fourth pool's pre-activation (conv₈'s output).
Equations
- Proofs.Cifar8TieG.cifar8Pre4 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ W₇ b₇ W₈ b₈ x = Proofs.Cifar8TieG.cifar8Up W₇ b₇ W₈ b₈ (Proofs.Cifar8TieG.cifar8Pre3 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ x)
Instances For
Twins of the second pool: equal at every weight of convs 1–4, in every channel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Twins of the third pool: equal at every weight of convs 1–6, in every channel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Twins of the fourth pool: equal at every weight of the eight convs, in every channel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The smooth-point bundle the loss gradient needs. Every ReLU off its kink; every window of each pool dead or tied only between that pool's twins; each selection naming a maximum of every window.
- pool1 : SmallParamGrad.MaxPool2SmoothUpTo (CnnFold.CnnPoolTwin c1 kH kW x) (Tensor3.unflatten (CnnFold.cnnPoolPre W₁ b₁ W₂ b₂ x))
- pool2 : SmallParamGrad.MaxPool2SmoothUpTo (Cifar8PoolTwin2 c1 c2 kH kW x) (Tensor3.unflatten (cifar8Pre2 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ x))
- pool3 : SmallParamGrad.MaxPool2SmoothUpTo (Cifar8PoolTwin3 c1 c2 c3 kH kW x) (Tensor3.unflatten (cifar8Pre3 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ x))
- sel3 : SmallParamGrad.PoolSelDom σ₃ (relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) (cifar8Pre3 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ x))
- pool4 : SmallParamGrad.MaxPool2SmoothUpTo (Cifar8PoolTwin4 c1 c2 c3 c4 kH kW x) (Tensor3.unflatten (cifar8Pre4 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ W₇ b₇ W₈ b₈ x))
- sel4 : SmallParamGrad.PoolSelDom σ₄ (relu (c4 * (2 * h) * (2 * w)) (cifar8Pre4 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ W₇ b₇ W₈ b₈ x))
- z9 (k : Fin d1) : dense W₉ b₉ (maxPoolFlat c4 h w (relu (c4 * (2 * h) * (2 * w)) (cifar8Pre4 W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ W₇ b₇ W₈ b₈ x))) k ≠ 0
Instances For
Every cifar8 gradient node is the gradient of L in that parameter: the 22 un-fused nodes
cifar8_train_step_tiedG states, each at the cotangent the chain threads to its layer (each
pool routed at its selection), stated against L of cifarCnn8Forward with that one
parameter varied.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every cifar8 gradient node is the gradient of L in that parameter, whenever g is L's
gradient at the logits.
Hypotheses: odd kernels, and Cifar8LossSmoothAt — every ReLU off its kink, every window of
each pool dead or tied only between cells that are the same function of the weights upstream
of it, each selection naming a maximum of every window.
The artifact's loss: every node is the gradient of the softmax cross-entropy at label,
g the emitted loss cotangent.