# karpathy/micrograd

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/karpathy-micrograd).**

16,455 stars · 2,587 forks · Jupyter Notebook · MIT

## Links

- GitHub: https://github.com/karpathy/micrograd
- awesome-repositories: https://awesome-repositories.com/repository/karpathy-micrograd.md

## Description

micrograd is a scalar autograd engine and minimal neural network library. It implements a system for reverse-mode automatic differentiation over a dynamic graph of scalar operations to calculate gradients.

The project includes a computation graph visualizer that generates representations of data flow and gradient propagation. It provides a set of tools for constructing and training multi-layer perceptrons using an API modeled after PyTorch.

The library covers the fundamentals of backpropagation and neural network construction, specifically for binary classification tasks. This includes the implementation of automatic gradient computation and layer-based model abstractions.

The project is provided as a Jupyter Notebook.

## Tags

### Artificial Intelligence & ML

- [Automatic Differentiation](https://awesome-repositories.com/f/artificial-intelligence-ml/automatic-differentiation.md) — Implements a reverse-mode automatic differentiation engine using the chain rule to compute gradients.
- [Automatic Differentiation Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/automatic-differentiation-engines.md) — Implements a custom engine that computes gradients of mathematical functions by traversing computational graphs.
- [Backpropagation](https://awesome-repositories.com/f/artificial-intelligence-ml/backpropagation.md) — Implements the backpropagation algorithm to calculate gradients of loss functions for updating model parameters.
- [Neural Network Training Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-training-frameworks.md) — Provides a minimal library for constructing and training multi-layer perceptrons using a PyTorch-like API.
- [Computational Graph Visualizations](https://awesome-repositories.com/f/artificial-intelligence-ml/computational-graph-visualizations.md) — Generates visual representations of the computational graph to show data flow and gradient propagation.
- [Neural Network Classification](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning-classification/neural-network-classification.md) — Provides the ability to construct and train multi-layer perceptrons for binary classification tasks.
- [Neural Network Construction](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-construction.md) — Enables the design and building of deep learning architectures using layer-based model abstractions. ([source](https://github.com/karpathy/micrograd#readme))

### Programming Languages & Runtimes

- [Neural Network Module Abstractions](https://awesome-repositories.com/f/programming-languages-runtimes/class-based-architecture/neural-network-module-abstractions.md) — Provides high-level class abstractions to encapsulate neural network layers, weights, and biases.

### Scientific & Mathematical Computing

- [Autograd Engines](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/arithmetic-number-types/arithmetic-operations/scalar/autograd-engines.md) — Implements a small reverse-mode automatic differentiation engine over a dynamic graph of scalar operations.
- [Scalar Primitives](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/mathematical-libraries-and-utilities/mathematical-libraries/mathematical-function-implementations/scalar-primitives.md) — Uses scalar-based primitives that maintain gradient state and local derivative logic.

### Software Engineering & Architecture

- [Directed Acyclic Graph Engines](https://awesome-repositories.com/f/software-engineering-architecture/directed-acyclic-graph-engines.md) — Builds a dynamic directed acyclic graph to track scalar operations and their dependencies for gradient calculation.

### Education & Learning Resources

- [Deep Learning Education](https://awesome-repositories.com/f/education-learning-resources/deep-learning-education.md) — Serves as an educational resource for learning neural network theory and backpropagation via a minimal implementation.

### Part of an Awesome List

- [Model Training](https://awesome-repositories.com/f/awesome-lists/ai/model-training.md) — Lightweight autograd engine for educational purposes.
- [Model Training Frameworks](https://awesome-repositories.com/f/awesome-lists/ai/model-training-frameworks.md) — Lightweight autograd engine for understanding neural network foundations.
