MNIST from scratch: the tutorial code you wish you'd written
A cleaned-up, zero-dependency NumPy implementation of a classic neural network, fixing the indexing headaches that plague beginners cross-referencing Nielsen's book with Andrew Ng's course.

What it does
Trains a multilayer neural network to classify handwritten digits (MNIST) using only NumPy. The code follows Michael Nielsen’s Neural Networks and Deep Learning but with a scikit-learn-style API: fit, predict, validate.
The interesting bit
The author actually bothered to fix the 0-indexed vs. 1-indexed mess that trips up anyone comparing Nielsen’s Python with Ng’s MATLAB. Biases and weights use consistent layer indexing, and the redundant weights[0] / biases[0] placeholders are explicitly documented rather than silently confusing newcomers.
Key highlights
- Pure NumPy — no TensorFlow, no PyTorch, no hidden abstractions
- Scikit-learn-style API (
fit,predict,validate) instead of raw script execution - Extensive documentation of tensor dimensions and indexing conventions with ASCII art diagrams
- Explicitly designed for beginners cross-referencing multiple canonical tutorials
- Single-command execution:
python main.py
Caveats
- README doesn’t list accuracy numbers, training time, or hardware requirements
- No mention of modern conveniences like ReLU, dropout, or batch normalization — strictly old-school sigmoid
- 787 stars suggests it resonates, but the project appears dormant (no recent commit info in sources)
Verdict Grab this if you’re teaching yourself neural networks and want to see the gears turn without framework magic. Skip it if you need production-ready code or modern architecture patterns — this is pedagogy, not performance.