captum
Model Interpretability for PyTorch
Decision gist · record as of 2026-08-14
Yes. Captum is a production-stable, actively maintained library from PyTorch with no known vulnerabilities, low install friction, and permissive licensing. It is the standard choice for PyTorch model interpretability and is worth installing if you need to understand or explain neural network predictions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch >= 2.3 and Python >= 3.10.
- Low install friction with a pure-Python wheel.
- Active maintenance with recent releases; last commit 2026-08-14.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with attribution and liability disclaimers.
last release 2026-04-17 (119 days) · last repo commit 2026-08-14 · 5,685 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 548,326 downloads/mo, #6,064 on PyPI
Alternatives
Verify before relying
pip install captum
import torch
from captum.attr import IntegratedGradients
model = torch.nn.Linear(3, 2)
ig = IntegratedGradients(model)
input_tensor = torch.rand(1, 3)
baseline = torch.zeros(1, 3)
attributions = ig.attribute(input_tensor, baseline, target=0)- Whether all interpretability algorithms scale efficiently to very large models or datasets.
- Specific performance characteristics or computational overhead compared to alternative attribution methods.
- Compatibility with non-standard PyTorch model architectures or custom layers.
What it is and what it does
Captum is a PyTorch library for understanding and interpreting neural network predictions by computing attribution scores that show which input features, neurons, or training examples contribute most to a model's output. It implements state-of-the-art interpretability algorithms including Integrated Gradients, DeepLift, TCAV, and TracIn influence functions, along with adversarial perturbation capabilities for generating counterfactual explanations.
The library is designed for model developers who need to debug and improve their models, interpretability researchers benchmarking new algorithms, and production engineers troubleshooting model behavior. It integrates with domain-specific PyTorch libraries like torchvision and torchtext, and provides convergence metrics to assess approximation quality for gradient-based attribution methods.
Use it for
- Debug unexpected model predictions by identifying which input features most influenced the output.
- Validate that a model learned meaningful patterns rather than spurious correlations in training data.
- Generate explanations for end users on why a model made a specific recommendation or classification decision.
- Benchmark new interpretability algorithms against established methods in the Captum library.
- Identify important neurons and layers within a network to guide model compression or architecture redesign.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Captum is a production-stable, actively maintained library from PyTorch with no known vulnerabilities, low install friction, and permissive licensing. It is the standard choice for PyTorch model interpretability and is worth installing if you need to understand or explain neural network predictions.
Install
captum on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance with recent releases; last commit 2026-08-14. Requires PyTorch >= 2.3 and Python >= 3.10, which are standard modern versions.
Requires PyTorch >= 2.3 and Python >= 3.10.
License in practice
BSD-3-Clause permissive license allows commercial and private use with attribution and liability disclaimers.
Quickstart
pip install captum
import torch
from captum.attr import IntegratedGradients
model = torch.nn.Linear(3, 2)
ig = IntegratedGradients(model)
input_tensor = torch.rand(1, 3)
baseline = torch.zeros(1, 3)
attributions = ig.attribute(input_tensor, baseline, target=0)
Verify before relying
- Whether all interpretability algorithms scale efficiently to very large models or datasets.
- Specific performance characteristics or computational overhead compared to alternative attribution methods.
- Compatibility with non-standard PyTorch model architectures or custom layers.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesmatplotlibnumpypackagingtorchtqdm |
| Maintenance | Actively maintained 119 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 548,326 / month, #6,064 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchProgramming Language :: Python :: 3 :: OnlyTopic :: Scientific/Engineering |
Evidence: captum-0.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytorch model interpretability”
- captumCaptum provides model interpretability algorithms for PyTorch,…
- sae-lensSAE Lens trains and analyzes sparse autoencoders for mechanistic…
- neuralprophetNeuralProphet is a PyTorch-based framework for interpretable time…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also sae-lens · entmax · interpret-core · interpret · shap · lime · torch · pytorch_revgrad · pytorch-forecasting · stable-baselines3