Skip to main content

Model interpretability for PyTorch

Project description

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

License

ADGT is BSD licensed, as found in the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ADGT-0.0.2.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

ADGT-0.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file ADGT-0.0.2.tar.gz.

File metadata

  • Download URL: ADGT-0.0.2.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.7

File hashes

Hashes for ADGT-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0834699138adecdd6da7328385f8a003952d5af48fd615e3e67a75dfe9b478d6
MD5 b16a0583ddbf255f75504bdd18d6e111
BLAKE2b-256 b9e6af67042854ab709d53dfccf296f34a8c4a26e5aa3275d29ce3f399db778c

See more details on using hashes here.

File details

Details for the file ADGT-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ADGT-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.7

File hashes

Hashes for ADGT-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5faf60279d165e5260902695de6bd2fcab7fea7ac8e8226e88beac44c24a96e5
MD5 7c61775556581f144cad2833b1168345
BLAKE2b-256 787ca4096a048e22107c8f6a9597d1777bc71fd2c4be6328de2b7e4c5113adad

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page