micrograd is an exact reimplementation of micrograd by Andrej Karpathy, written for educational and experimental purposes.
This project features a minimalistic automatic differentiation engine and a tiny neural network module — all built from scratch and under 100 lines of code.
- Reverse-mode autodiff (backpropagation)
- Scalar-based computation graph
- Tiny but expressive neural network (MLP)
- Easy to read and extend
train.py— sample training loop using the MLP classmicrograd/— contains the autodiff and neural net logic (copied exactly from micrograd)
This code is a faithful reproduction of micrograd by Andrej Karpathy.
Same license as the original micrograd — MIT.