COMPLETE READING EDITION

Backpropagation.
How one mistake changes a network.

All five chapters, static lab comparisons and worked answers. This edition loads no scripts.

Notation

Forward value
The result of an operation at the current parameters: for example z,h,y^z,h,\hat y.
Local derivative
Sensitivity of one operation’s output to one input, with other inputs fixed.
Adjoint qˉ\bar q
Loss sensitivity ∂L/∂q\partial L/\partial q, accumulated over all relevant downstream routes.
Gradient gg
Partial derivatives collected in the same order and shapes as parameters.
Learning rate η\eta
Multiplier in this guide’s plain update Δθ=−ηg\Delta\theta=-\eta g.
ReLU at zero
A nondifferentiable boundary. The lab chooses a zero backward rule there.

Sources

  1. PyTorch 2.14 · Autograd mechanics

    Reverse-mode graph differentiation and nondifferentiable-operation conventions. BP-C01, BP-C04.

  2. PyTorch · Optimizing model parameters

    Separate zero_grad, backward and step operations. BP-C03, BP-C06.

  3. PyTorch 2.14 · SGD

    The update rule; our case omits momentum and weight decay. BP-C05.

  4. PyTorch 2.14 · Gradcheck mechanics

    Centered numerical differences versus analytic derivatives. BP-C07.

  5. PyTorch 2.14 · gradcheck API

    Double precision and nondifferentiable-point caveats. BP-C08.

Reproduce the arithmetic

The canonical model (local copy) provides forward, backward, step, trajectory and finiteDifference functions. It uses JavaScript binary64 arithmetic, no randomness and no network. The companion code-lab/run.mjs generates all output cases using this same model.

# From the project folder
node code-lab/run.mjs
node --test site/model.test.mjs
# Optional, when PyTorch is already installed:
python -B code-lab/verify_pytorch.py

The build bundles KaTeX 0.18.5 locally and emits accessible MathML. Numerical checks (local copy) cover independent hand values, finite differences, missing-path bugs, boundary conventions and repeated steps. Browser checks and limitations are recorded in the project’s audit report.

Current primary documentation was inspected on 4 September 2026 (version 2.14 where pinned). Local optional framework verification used PyTorch 2.12.0+cpu with float64; documentation version and executed version are separate. No library download or real training dataset was needed.