--- id: captum version: "0.9.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # captum — Model Interpretability for PyTorch License: permissive · Maintenance: active · Downloads: 548.3K/mo ## 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 above — verify before relying. Captum provides model interpretability algorithms for PyTorch, including integrated gradients, saliency maps, and other attribution methods to understand which features and training examples drive model predictions. 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 pip install captum uv add captum poetry add captum ## Installing captum 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. 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) Requires PyTorch >= 2.3 and Python >= 3.10. 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_current - Install friction: low - Maintenance: active - Downloads: 548.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytorch model interpretability, feature attribution neural networks, integrated gradients pytorch, explainable ai pytorch, model explanation algorithms, saliency maps pytorch, neural network feature importance, model-explainability, pytorch-ecosystem, interpretability [View on SkillFed](https://skillfed.io/packages/captum) · [View on PyPI](https://pypi.org/project/captum/)