Analysis updated 2026-06-24
Read the 100-line engine to learn exactly how backpropagation works
Train a tiny two-layer net to classify points in a notebook
Use micrograd as the basis of a teaching module on automatic differentiation
Extend the Value class with new operations as an exercise
| karpathy/micrograd | selfteaching/the-craft-of-selfteaching | camenduru/stable-diffusion-webui-colab | |
|---|---|---|---|
| Stars | 15,832 | 15,881 | 15,942 |
| Language | Jupyter Notebook | Jupyter Notebook | Jupyter Notebook |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 1/5 | 1/5 |
| Audience | researcher | general | general |
Figures from each repo's GitHub metadata at analysis time.
pip install micrograd and open the demo notebook, Graphviz is optional for visualizing the computation graph.
Micrograd is a tiny educational library that shows how the core math inside AI neural networks actually works. A neural network learns by repeatedly adjusting its internal numbers, called weights, to get better at a task. The mechanism that figures out how to adjust those weights is called backpropagation. Micrograd implements backpropagation from scratch in about 100 lines of Python code so learners can see exactly how it works rather than just trusting a larger library to handle it invisibly. The library defines a Value object that tracks every mathematical operation performed on a number, addition, multiplication, powers, and so on. After running a calculation forward (called a forward pass), you can call .backward() on the result and the library automatically figures out how much each input number contributed to the final output. This is the core of how neural networks learn. On top of this engine, micrograd provides a small neural network library with a PyTorch-like interface, meaning its API looks similar to PyTorch, one of the most popular AI frameworks. The README includes a demo notebook that trains a two-layer neural network to classify data points into two groups. You would use micrograd if you want to deeply understand how modern AI learning works under the hood, rather than just using a ready-made framework. It is aimed at students and curious developers. It is written in Python and distributed as an installable package.
A tiny educational autograd engine in about 100 lines of Python plus a PyTorch-like neural net layer on top, written by Andrej Karpathy.
Mainly Jupyter Notebook. The stack also includes Python, Jupyter, Graphviz.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Verify against the repo before relying on details.