#6565th of 171 in Learning and cookbooks
micrograd
Scalar-valued autograd engine and tiny neural net library in about 150 lines of Python
Watch puts micrograd on your watch list: its new releases and known problems since your last visit. Kept in this browser, no account.micrograd is on your watch list. Its new releases and problems show there.
- Stars
- 19.2k
- License
- MIT
- Last commit
- Aug 2026
- Language
- Jupyter Notebook
15,091 on 25 Mar 202619,184 on 25 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
micrograd implements reverse-mode autodiff over a dynamically built DAG of scalar values, with a small PyTorch-like neural network module on top. The engine is about 100 lines and the nn library about 50. A demo notebook trains a 2-layer MLP with two 16-node hidden layers as a binary classifier on the moon dataset, using an SVM max-margin loss and SGD.
Who it is for: Students and engineers learning how backpropagation and autograd work
Strengths
- Engine and nn library are about 100 and 50 lines, readable in one sitting
- PyTorch-like API: Value, Neuron and MLP classes with backward()
- Notebook demos training on the moon dataset and graphviz graph tracing
- Unit tests check gradients against PyTorch as a reference
Weaknesses
- Operates on scalars only, so no tensors and very slow for real models
- No GPU support
- Demo covers only binary classification with an SVM loss and SGD
- Tests need PyTorch installed; no tagged releases
What it needs
- no GPU
- Needs PyTorch (tests only), graphviz (tracing notebook)
Also in Learning and cookbooks
See all 171| Rank | Project | Score |
|---|---|---|
| #63 | agentcore-samplesSample code and tutorials for deploying agents on Amazon Bedrock AgentCore | 54 out of 100 |
| #64 | happy-llmChinese-language course on LLM theory and building a LLaMA2-style model | 53 out of 100 |
| #66 | all-in-ragChinese-language RAG tutorial with code, from chunking to Graph RAG | 52 out of 100 |
| #67 | tensorflow/examplesOfficial TensorFlow example notebooks, community samples and course material | 52 out of 100 |
| #68 | deep-rl-classHugging Face's free course on deep reinforcement learning, with notebooks | 52 out of 100 |