workwriting
résumé

Have something worth building?

0xkhingx@gmail.com
Dre · software engineer, Lagos
workwritingrésumégithublinkedinx

© 2026 Oluwadamilare Ogundele

back to top ↑
← Work

MNIST from scratch

Backprop by hand, then checked honestly against PyTorch.

Machine learning · from scratch · 2025 · NumPy, Python, PyTorch, MNIST

Source ↗

Reproducing the mechanics by hand

I wanted to understand the mechanics of training well enough to reproduce them by hand, then compare the result against a PyTorch baseline without hand-waving the math. Small on purpose: a two-layer network where every shape bug is visible and every gradient can be checked.

Keeping the comparison fair

Forward pass, backpropagation, and stochastic gradient descent in NumPy, with seed, data split, and architecture controlled so the PyTorch baseline comparison stays honest. The model converged close to the baseline — and the shape bugs along the way built sharper intuition for how training actually fails than any tutorial could.

Where it landed

The model converged close to the PyTorch baseline and turned shape bugs into a much sharper intuition for how training actually fails.

Frameworks hide exactly the failure modes you need to recognize in production. Next step would be extending the scratch implementation to convolutions to feel weight sharing the same way.

I wrote about it: backprop by hand

NextNigerian Language Classifier→