Captum is a model interpretability and understanding library for PyTorch. Captum means comprehension in latin and contains general purpose implementations of integrated gradients, saliency maps, smoothgrad, vargrad and others for PyTorch models. It has quick integration for models built with domain-specific libraries such as torchvision, torchtext, and others.
Captum is currently in beta and under active development!
TODO: Add content here
TODO: Add content here
Installation Requirements
- Python >= 3.6
- PyTorch >= 1.2
The latest release of Captum is easily installed either via Anaconda (recommended):
conda install captum -c pytorch
or via pip
:
pip install captum
If you'd like to try our bleeding edge features (and don't mind potentially running into the occasional bug here or there), you can install the latest master directly from GitHub:
pip install git+https://github.com/pytorch/captum.git
Manual / Dev install
Alternatively, you can do a manual install. For a basic install, run:
git clone https://github.com/pytorch/captum.git
cd captum
pip install -e .
To customize the installation, you can also run the following variants of the above:
pip install -e .[dev]
: Also installs all tools necessary for development (testing, linting, docs building; see Contributing below).pip install -e .[tutorials]
: Also installs all packages necessary for running the tutorial notebooks.
To execute unit tests from a manual install, run:
# running a single unit test
python -m unittest -v tests.attributions.test_saliency
# running all unit tests
pytest -ra
TODO: Add content here
See the CONTRIBUTING file for how to help out.
- Axiomatic Attribution for Deep Networks
- Investigating the influence of noise and distractors on the interpretation of neural networks
- SmoothGrad: removing noise by adding noise
- Local Explanation Methods for Deep Neural Networks Lack Sensitivity to Parameter Values
- Investigating the influence of noise and distractors on the interpretation of neural networks
- Conductance - How Important is a neuron?
Captum is BSD licensed, as found in the LICENSE file.