Keep the definitions close.
Notation, primary sources, and the exact boundary around the experiment.
Notation
- Forward value
- The result of an operation at the current parameters: for example .
- Local derivative
- Sensitivity of one operation’s output to one input, with other inputs fixed.
- Adjoint
- Loss sensitivity , accumulated over all relevant downstream routes.
- Gradient
- Partial derivatives collected in the same order and shapes as parameters.
- Learning rate
- Multiplier in this guide’s plain update .
- ReLU at zero
- A nondifferentiable boundary. The lab chooses a zero backward rule there.
Sources behind the explanation
Sources support the computational rules. Toy numbers are derivations of the declared model. They do not establish forecasting performance or measured learning gains.
- PyTorch 2.14 · Autograd mechanics
Reverse-mode graph differentiation and nondifferentiable-operation conventions. BP-C01, BP-C04.
- PyTorch · Optimizing model parameters
Separate zero_grad, backward and step operations. BP-C03, BP-C06.
- PyTorch 2.14 · SGD
The update rule; our case omits momentum and weight decay. BP-C05.
- PyTorch 2.14 · Gradcheck mechanics
Centered numerical differences versus analytic derivatives. BP-C07.
- 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.pyThe 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.