skillfed

autograd

Efficiently computes derivatives of NumPy code.

autograd v1.9.1 5.6M downloads/30d#2,063 on PyPI7,523
Permissive license MIT Active released

What it is and what it does

Autograd is a library that automatically computes derivatives of Python and NumPy functions without requiring you to write gradient code by hand. It handles a large subset of Python's features—loops, conditionals, recursion, closures—and can differentiate functions multiple times over. The library supports both reverse-mode differentiation (efficient for scalar-valued functions with many inputs, as in neural networks) and forward-mode differentiation, and these can be composed arbitrarily.

The main use case is gradient-based optimization: you define a function in NumPy, wrap it with autograd's grad function, and get back a function that computes its gradient. This is particularly useful for training neural networks, Bayesian inference, and other machine learning tasks where you need gradients but don't want to manually implement backpropagation. Autograd provides a thin wrapper around NumPy that tracks operations for differentiation.

Use it for:

  • Training neural networks by computing gradients for backpropagation without manual derivative code.
  • Implementing Bayesian inference methods like HMC or variational inference that require gradients of log-probability functions.
  • Optimizing functions where analytical gradients are tedious or error-prone to derive by hand.
  • Computing higher-order derivatives (e.g., Hessians) for second-order optimization methods.
  • Prototyping machine learning models in pure Python/NumPy with automatic gradient computation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Autograd automatically computes derivatives of Python and NumPy code, supporting both reverse-mode (backpropagation) and forward-mode differentiation for gradient-based optimization.

Yes. Autograd is actively maintained, has no known vulnerabilities, installs with low friction, and is permissively licensed. It is a solid choice if you need automatic differentiation for NumPy-based code and prefer a lightweight, pure-Python solution over heavier frameworks.

Install

autograd on PyPI

pip

pip install autograd

uv

uv add autograd

poetry

poetry add autograd

Installing autograd

Before you install

Low friction install with a single runtime dependency (numpy). Actively maintained with recent releases; last commit 2026-08-10. Supports current Python versions (3.10–3.14).

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in proprietary and open-source projects with minimal restrictions.

Quickstart

pip install autograd

import autograd.numpy as np
from autograd import grad

def f(x):
    return x**3

grad_f = grad(f)
print(grad_f(2.0))  # Computes df/dx at x=2.0

Verify before relying

  • Whether SciPy integration (optional dependency) is required for your use case or only for specific features.
  • Performance characteristics compared to other autodiff frameworks for your problem scale.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 43 days since the last release
Last repo commit
First released
Downloads 5,606,457/month — #2,063 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: autograd-1.9.1-py3-none-any.whl

Keywords: Automatic differentiation, NumPy, Python, SciPy, backpropagation, gradients, machine learning, neural networks, optimization

Development Status :: 4 - BetaIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering

Tags

automatic differentiation pythoncompute gradients numpybackpropagation libraryderivative calculationgradient-based optimizationneural network trainingreverse-mode differentiation
autodiffgradient-computationoptimization

More Scientific/Engineering packages