karpathy/micrograd
A minimal autograd engine implementing reverse-mode automatic differentiation and a small neural network library with PyTorch-like API.

This repository provides a lightweight autograd engine that operates over a dynamically built directed acyclic graph of scalar values, implementing backpropagation for gradient computation. It includes a small neural network library built on top that mimics PyTorch’s API, allowing users to construct multilayer perceptrons for binary classification tasks. The implementation uses only about 100 and 50 lines of code respectively, making it suitable for educational purposes while still capable of training real models using SGD optimization.