numpygrad

Getting Started

  • Getting Started

Concepts

  • How Autograd Works
  • Disabling Autograd

User Guide

  • The Training Loop
  • Custom Modules

API Reference

  • Array
  • Random (npg.random)
  • Operators
  • Neural Network (nn)
  • Optimizers (optim)
  • Utilities (utils)

Examples

  • 1D Regression
  • 2D Classification
  • MNIST
  • GPT-2 Character Language Model
numpygrad
  • numpygrad
  • View page source

numpygrad

A NumPy-only autograd and neural network library with a PyTorch-like API. No C++ extensions, no CUDA — just readable, hackable Python.

Getting Started

  • Getting Started

Concepts

  • How Autograd Works
    • The computation graph
    • Calling backward()
    • Gradient accumulation
    • Non-differentiable operations
    • Broadcasting and gradients
  • Disabling Autograd
    • npg.no_grad
    • Use as a decorator
    • Typical usage

User Guide

  • The Training Loop
    • Data
    • Model
    • Optimizer
    • The loop
    • Validation
    • Putting it all together
  • Custom Modules
    • Minimal example
    • Composing modules
    • Using Sequential
    • Buffers
    • Inspecting parameters

API Reference

  • Array
  • Random (npg.random)
  • Operators
  • Neural Network (nn)
  • Optimizers (optim)
  • Utilities (utils)

Examples

  • 1D Regression
  • 2D Classification
  • MNIST
  • GPT-2 Character Language Model
Next

© Copyright 2026, Nick Richardson.

Built with Sphinx using a theme provided by Read the Docs.