# Adam reference

Run `python examples/adam.py` for built-in checks, or add `--json` for the scalar sparse-gradient trace used by the JavaScript parity test. No installation is required. Python 3.10+ is sufficient.

This implements Algorithm 1 of Kingma and Ba, _Adam: A Method for Stochastic Optimization_, selected arXiv:1412.6980v9 (2017-01-30; ICLR 2015 publication). Epsilon is outside the square root. The independent `moments`, `bias`, and `update` source regions supply the website excerpts through the central synchronizer.

Inputs are authored scalar gradients. There is no trained network, dataset, accelerator benchmark, weight decay, checkpoint, autodiff or mixed-precision optimizer. The example does not reproduce the paper's empirical learning curves or prove convergence. Floating-point values use Python's binary64 arithmetic.

Verification: `node --test test/adam.test.mjs` checks the first-step closed form, constant-gradient correction, zero gradients, remembered impulses, parameter boundaries and JS/Python parity. Source PDF/crop provenance is in `public/images/papers/adam/source-crops.json`.
