← things I build
learngrad.
A scalar-valued autograd engine and small neural network library built to learn how backpropagation works. Inspired by micrograd.
TECH USED
Python
NumPy
Pytest
GitHub Actions

the full path
From problem to what's next.
In the order it actually happened. Use the route to jump around.
01THE PROBLEM
Frameworks hide how backpropagation works. Reverse-mode autodiff is easiest to understand when the whole engine is small enough to read and every gradient can be checked.
02THE SOLUTION
A Value node stores data, gradient, parents and a backward closure; a topological sort drives reverse-mode accumulation. Neuron, Layer and MLP build on it, with SGD, momentum, RMSProp and Adam optimizers.
WHAT I BUILT
- 01Built the Value engine: scalar nodes with reverse-mode backprop over a topologically sorted graph.
- 02Added Neuron, Layer and MLP with ReLU hidden layers, and SGD, SGD with momentum, RMSProp and Adam, each with learning-rate decay.
- 03Checked every operation's gradient against finite differences, with 24 tests running on Python 3.10 to 3.13 in CI.
- 04Packaged and published it to PyPI, with a demo notebook that trains on make_circles.
03HOW IT'S BUILT
The system, end to end.
TRAINING LOOP
- STEP 01Valuedata · grad · backward closure
- STEP 02MLPNeuron, Layer, MLP on Value
- STEP 03Losshinge plus L2 in the demo
- STEP 04OptimizerSGD · momentum · RMSProp · Adam
04WHAT BROKE,
AND THE FIX
AND THE FIX
FIX →Reworked the f-strings, added a Python 3.10 to 3.13 CI matrix and 24 tests, and merged the fix as 0.2.2.
05WHERE IT IS NOW
- IDEA
- BUILDING
- LIVE
Published on PyPI, with CI on Python 3.10 to 3.13.