Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

E Reproducibility Information

University of Lausanne

Every empirical statement in the main text relies on the companion notebooks listed in the Execution Map. Bit-exact reproducibility on a different machine requires fixing both the random seeds and the floating-point environment; Table Table E.1 summarizes the conventions used in this script’s notebooks.

Table E.1:Reproducibility conventions used by the companion notebooks. The conventions pin random seeds and document hardware, software, and precision choices; bit-exact reproduction additionally requires the deterministic settings and caveats described below the table.

ItemConvention
Random seedsEach notebook declares a SEED constant in cell 1 (default 0); the corresponding framework seeds (numpy.random.seed(SEED), torch.manual_seed(SEED), tf.random.set_seed(SEED), and jax.random.PRNGKey(SEED) where the framework is used) are derived from it. Per-cell offsets and per-iteration deviations are documented inline. Notebook-by-notebook normalisation against this convention is tracked through the chapter audits; some legacy notebooks still hard-code a literal seed and are scheduled for normalisation.
Run-mode budgetEach notebook declares RUN_MODE \in {smoke, teaching, production} alongside SEED in cell 1. smoke is sized for a single CPU core (CI-friendly); teaching for one consumer GPU; production for an A100 or larger. Per-notebook hyperparameters (epochs, batch sizes, restart counts) are gated on RUN_MODE.
HardwareClassroom-scale runs target a single CPU core or one consumer GPU (e.g. NVIDIA T4 / RTX 3060). Production runs use one A100 or larger; this is documented per-notebook in the chapter.
Software stackPython 3.10\geq 3.10, TensorFlow 2.15\geq 2.15, PyTorch 2.0\geq 2.0, JAX 0.4.20\geq 0.4.20, GPyTorch 1.11\geq 1.11. Pinned versions live in requirements.txt on the companion repository. JAX appears in the Krusell--Smith warm-up notebook in lectures/lecture_10_* (sequence-space DEQNs); the other lectures use TensorFlow or PyTorch.
Numerical precisionTensorFlow / PyTorch default to float32; PINNs and EMINN training use float64 where second-order derivatives are sensitive (documented inline).
GPU determinismOptional, bit-exact runs only: set CUBLAS_WORKSPACE_CONFIG=:4096:8 and torch.use_deterministic_algorithms(True) on the PyTorch side, and call tf.config.experimental.enable_op_determinism() on the TensorFlow side. Default classroom and production runs leave these unset, accepting last-decimal nondeterminism in exchange for speed; small accuracy regression possible when the flags are on.
Reported numbersWhere the script states an accuracy or runtime, the source is either the cited paper (for production-scale results) or the companion notebook with the seed above (for classroom-scale results).

For full bit-exact reproduction, e.g. for a regulatory-grade audit, the determinism flags above are necessary but not sufficient: GPU non-determinism in atomic accumulators and BLAS implementation differences across CUDA versions can still cause diverging results in the last few decimal places. This is a known limitation of GPU-accelerated deep learning and is one of the reasons Section 12.6 flags reproducibility-critical settings as a regime where deterministic finite-difference solvers may still be preferred.