--- id: autograd version: "1.9.1" license: MIT license_treatment: permissive maintenance: active --- # autograd — Efficiently computes derivatives of NumPy code. License: permissive · Maintenance: active · Downloads: 5.6M/mo ## 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 above — 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 pip install autograd uv add autograd 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_current - Install friction: low - Maintenance: active - Downloads: 5.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags automatic differentiation python, compute gradients numpy, backpropagation library, derivative calculation, gradient-based optimization, neural network training, reverse-mode differentiation, autodiff, gradient-computation, optimization [View on SkillFed](https://skillfed.io/packages/autograd) · [View on PyPI](https://pypi.org/project/autograd/)