A Neural Network from Scratch
Building an automatic-differentiation engine and a neural network from nothing but Python’s arithmetic — no PyTorch, no NumPy, no libraries — and the mathematics that makes it work.
A note before you start
I wanted to understand what training a model means at the level of individual numbers, so I built the whole thing from scratch: a tiny automatic-differentiation engine, a neuron, a network of neurons, and the loop that makes them learn — using only Python’s built-in arithmetic, no numerical libraries whatsoever. This post is the account I wish I had been handed. It is written to be self-contained and mathematically explicit: by the end you should be able to derive backpropagation yourself, not merely recognise it.
Tags: #Machine learning #Deep learning #Mathematics