Learn
The whole stack fits in your head. These paths take you through everything this project knows — verified code you can run, not slides.
Run the gates
The fastest way in is execution: two commands verify all 23 gradient checks and every fit gate on your machine. If something fails, it aborts loudly — that honesty is the lesson.
QuickstartRead the source like a book
Nine modules, each readable in one sitting: tensor ops → arena autograd → losses → dense/conv/transformer layers → optimizers → trainer. A suggested reading order with what each module teaches.
Module by moduleThe API, as implemented
ml/docs/API.md documents every public symbol with its actual signature — including the flattened-sequence convention and the arena lifecycle that make this framework unusual.
One training epochSix evenings through the source
- 1
ml/tensor.mojoRow-major tensors as plain Lists of Float64; broadcast, reduce, reshape. - 2
ml/autograd.mojoValue nodes, the Graph arena, ~20 op builders, backward dispatch. - 3
ml/loss.mojoFused stable softmax+CE as one autograd op; eps clamping done consistently. - 4
ml/layers.mojoDense, Conv2D via im2col, MaxPool by max-index, Embedding/LayerNorm/MHA. - 5
ml/optim.mojoSGD → momentum → Adam → AdamW with decoupled weight decay. - 6
ml/models.mojoMLP, SimpleCNN, MiniGPT structs and the fit gates that certify them.
Finished the path? Train something yourself — the grokking recipe is fully specified in ml/models.mojo, and the full 30k-epoch reproduction takes about an hour.