karpathy

    karpathy/micrograd

    A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API

    deep-learning
    Jupyter Notebook
    MIT
    18.8K stars
    3.0K forks
    200 GitHub watchers
    Updated Nov 12, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    Loading star history...

    Where it stands

    Rank, growth pace and release cadence relative to everything GStars tracks.

    The project lists 2 contributors on GitHub.

    Peaked at #38 in the weekly ranking the week of Oct 26, its best in the past year.

    Use Cases & Benefits

    • Implements a minimal scalar autograd engine and a small neural network library with a PyTorch-like API for educational purposes.
    • Offers a highly concise and transparent codebase to understand backpropagation and neural network fundamentals in about 150 lines of code.
    • Use for learning and experimenting with reverse-mode automatic differentiation on scalar values in Python notebooks.
    • Use for building and training simple multi-layer perceptrons for binary classification with a clear, minimalistic implementation.
    • Use for visualizing computation graphs and gradients to gain intuition about neural network operations and backpropagation.

    Should you depend on it?

    License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.

    License

    MIT

    Permissive: commercial use, modification and redistribution are allowed with attribution.

    Community files

    • README: present

    Watch-outs

    • Owned by an individual account with only 2 contributors on GitHub; plan for bus-factor risk.
    • No GitHub releases; pin a commit or tag instead of a release.

    General guidance from repository metadata, not legal advice. How we score

    From the README

    A tiny Autograd engine (with a bite! :)). Implements backpropagation (reverse-mode autodiff) over a dynamically built DAG and a small neural networks library on top of it with a PyTorch-like API. Both are tiny, with about 100 and 50 lines of code respectively. The DAG only operates over scalar values, so e.g. we chop up each neuron into all of its individual tiny adds and multiplies. However, this is enough to build up entire deep neural nets doing binary classification, as the demo notebook shows. Potentially useful for educational purposes.

    Excerpt from the karpathy/micrograd README on GitHub (MIT license). © its authors.Read the full README on GitHub

    Daily snapshots

    Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots

    Forks

    3.0K+269

    Open issues

    84+6

    Compared with peers in Deep Learning

    Fastest-growing repositories GStars tracks in this cohort for the week of Nov 22, by 7-day star growth

    karpathy/micrograd compared with Deep Learning repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    harvard-edge/cs249r_book30.2K—659 days ago
    onnx/onnx21.7K—6343 days ago
    mlc-ai/web-llm19.4K—602 days ago
    karpathy/micrograd18.8K—6—
    lukas-blecher/LaTeX-OCR16.6K—18—
    SharpAI/DeepCamera3.1K—30250 days ago
    Category median19.4K—60—

    Also by karpathy

    Other repositories from this maintainer that GStars tracks

    Discover Repositories

    Search across tracked repositories by name or description