Idea · Sep 18, 2026
Full-Stack ML from Scratch with Live Viz
A scaffolded multi-week assignment where students implement a miniature transformer (no ML libraries) and watch their own training loop animate gradient magnitudes, weight distributions, and loss curves in a live browser dashboard.
What it would do
Students work in three phases over three to four weeks. Phase 1: implement matrix multiplication, softmax, and backpropagation by hand in Python, running against unit tests that verify numerical correctness. Phase 2: wire the components into a two-layer attention-based model and train it on a toy sequence prediction task (simple arithmetic or character-level text). Phase 3: integrate a provided WebSocket bridge so every gradient update streams to a React dashboard, which animates per-layer weight histograms, the attention heatmap, and the loss curve in real time. The assignment is intentionally bottoms-up: no PyTorch, no NumPy abstractions beyond raw arrays. The live visualization serves two purposes: it makes training feel tangible to students who have only seen ML as a black box, and it creates a natural debugging surface when gradients vanish or explode. Grading relies on passing test suites and a short written reflection on what the student observed in their own training run.
Key features
- Phase 1 scaffolded starter code with 30+ unit tests covering forward and backward pass correctness
- Phase 2 minimal transformer architecture constrained to under 500 lines of pure Python
- Phase 3 WebSocket bridge that streams gradient and weight tensors to the browser each training step
- Live dashboard: animated loss curve, per-layer weight histogram, 2D attention heatmap
- Autograder that runs the student's training loop and checks loss convergence and unit test pass rate