ADGT is a model interpretability and understanding library for PyTorch. ADGT means Attribution Draws Ground Truth contains general purpose implementations of Saliency, InputXGradient, Deconv, LRP, Guided_BackProp, GradCAM, SmoothGrad, DeepLIFT, IntegratedGradients, RectGrad, FullGrad, CAMERAS, GIG, and others for PyTorch models. It provide users a quick and simple start for state-of-the-art modified-BP attribution methods.
ADGT is currently in beta and under active development!
Installation
Installation Requirements
- Python >= 3.6
- PyTorch >= 1.2
- captum
Installing the latest release
You can just copy this code and install ADGT with
python setup.py install
or you can choose to install ADGT with pip
pip install ADGT
Getting Started
Just three lines code, you can use ADGT to interpret why the target model make a decision on input images.
import ADGT
adgt = ADGT.ADGT(use_cuda=True, name='ImageNet')
attribution=adgt.pure_explain(img, model, method, pth))
Note that img is the input image (pytorch tensor), model is the target model (pytorch model), method is the name of attribution methods (algorithms listed below), pth is the save path, the visualization of explanation results (see demo dir) are exported to this dir, if pth is None, it will not export such visualization, attribution is the attrubtion maps (pytorch tensor).
References of Algorithms
Saliency: Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps, K. Simonyan, et. al. 2014InputXGradient: Not Just a Black Box: Learning Important Features Through Propagating Activation Differences, Avanti Shrikumar et al. 2016Deconv: Visualizing and Understanding Convolutional Networks, Matthew D Zeiler et al. 2014Guided_Backprop: Striving for Simplicity: The All Convolutional Net, Jost Tobias Springenberg et al. 2015LRP: On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation, Sebastian Bach et al 2015GradCAM: Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization, Ramprasaath R. Selvaraju et al. 2017SmoothGrad: SmoothGrad: removing noise by adding noise, Daniel Smilkov et al. 2017DeepLift: Learning Important Features Through Propagating Activation Differences, Avanti Shrikumar et al. 2017 and Towards better understanding of gradient-based attribution methods for deep neural networks, Marco Ancona et al. 2018IntegratedGradients: Axiomatic Attribution for Deep Networks, Mukund Sundararajan et al. 2017 and Did the Model Understand the Question?, Pramod K. Mudrakarta, et al. 2018RectGrad: Why are Saliency Maps Noisy? Cause of and Solution to Noisy Saliency Maps, Beomsu Kim et al 2019FullGrad: Full-Gradient Representation for Neural Network Visualization, Suraj Srinivas et al 2019GIG: Guided Integrated Gradients: an Adaptive Path Method for Removing Noise, Andrei Kapishnikov et al 2021CAMERAS: CAMERAS: Enhanced Resolution And Sanity preserving Class Activation Mapping for image saliency, Mohammad A. A. K. Jalwana et al 2021
License
ADGT is BSD licensed, as found in the LICENSE file.
Metadata
Release files for ADGT 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ADGT-0.0.2.tar.gz | 3.6 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ADGT-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.6 MB
Release files / ADGT-0.0.2.tar.gz
| Download URL | ADGT-0.0.2.tar.gz |
|---|---|
| Size | 3.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0834699138adecdd6da7328385f8a003952d5af48fd615e3e67a75dfe9b478d6
|
|
BLAKE2b-256 checksum How to use checksums |
b9e6af67042854ab709d53dfccf296f34a8c4a26e5aa3275d29ce3f399db778c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.7
|
Release files / ADGT-0.0.2-py3-none-any.whl
| Download URL | ADGT-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5faf60279d165e5260902695de6bd2fcab7fea7ac8e8226e88beac44c24a96e5
|
|
BLAKE2b-256 checksum How to use checksums |
787ca4096a048e22107c8f6a9597d1777bc71fd2c4be6328de2b7e4c5113adad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.7
|
Security for ADGT 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.