CourseTransformers: From Attention to Trained, Served and Interpreted Models · Module 6: Training Dynamics · part 47 of 111
Part 47 · Module 6: Training Dynamics

Lab: One trainer, one recipe, exact resume

25 min read·13 Oct 2026
Module 6 · Lab · About 60 minutes · Needs: lessons 1 to 4 of this module, and Module 5's lab

What you are building

TINYFORMER-LAB AFTER MODULE 6 tinyformer/train.py trainer, monitor, manifest v0.5.0 package model, data, unchanged test_m06_train 6 tests, exact resume runs/base one run, 0.2563 git tag v0.6.0
The lab saves the module's trainer as train.py (blue) on the unchanged v0.5.0 package (grey), pins it with tests (green), records one base run (amber) and tags v0.6.0.

Sol 414 at Aurora Station. The four lessons left the trainer in notebook cells: Lesson 1's loop, Lesson 2's optimiser, schedule, clipping and accumulation switches, Lesson 4's monitor, checkpoints and resume. Kofi Mensah wants one recipe, in one file, for every later run. Hana Aoki wants proof that a run cut off by a life-support job can be picked up with nothing changed.

Today you save that trainer as tinyformer/train.py, pin it with tests, train base once end to end into its own folder in runs/, check the result against the course guide's 0.256, and tag v0.6.0.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.