demo
Project description
Pytorch iAlgebra
Pytorch iAlgebra is an interactive interpretation library for deep learning on Pytorch.
Pytorch iAlgebra provides an interactive frame for interpreting a group of deep leanring models using a set of interpretation methods.
iAlgebra Operations
Operators
Identity
$$ [\phi(x)]{i}=\frac{1}{d} \sum{k=0}^{d-1} \mathbb{E}{I{k}}\left[f\left(x_{I_{k} \cup{i}}\right)-f\left(x_{I_{k}}\right)\right] $$
Projection
$$ \left[\Pi_{w}(x)\right]{i}=\left{\begin{array}{cc}{\frac{1}{|w|} \sum{k=0}^{|w|-1} \mathbb{E}{I{k}}\left[f\left(x_{I_{k} \cup{i}}\right)-f\left(x_{I_{k}}\right)\right]} & {i \in w} \ {0} & {i \notin w}\end{array}\right. $$
Selection $$ \left[\sigma_{l}(x)\right]{i}=\left[\phi\left(x ; \bar{x}, f{l}\right)\right]_{i} $$
Join
$$ \left[x \bowtie x^{\prime}\right]{i}=\frac{1}{2}\left([\phi(x ; \bar{x}, f)]{i}+\left[\phi\left(x^{\prime} ; \bar{x}, f\right)\right]_{i}\right) $$
Anti-Join
$$ \left[x \diamond x^{\prime}\right]{i}=\left(\left[\phi\left(x ; x^{\prime}, f\right)\right]{i},\left[\phi\left(x^{\prime} ; x, f\right)\right]_{i}\right) $$
Supportive DNN and Interpretation Models
DNN Models
Model Performance on dataset Mnist
Dataset | Models | |
---|---|---|
Mnist | LeNet-L1 | LeNet-L2 |
Accuracy | 98.866% | 99.020% |
Model Performance on dataset Cifar10
Dataset | Models | |
---|---|---|
Cifar10 | Vgg19 -L1 | Vgg19-L2 |
Accuracy | 98.866% | 99.020% |
Interpretation Methods
In detail, we implement the following interpretation methods as the identity in Pytorch-iAlgebra.
-
GradSaliency from Simonyan et al.:Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps (CVPR 2013)
-
SmoothGrad from Smilkov et al.:SmoothGrad: removing noise by adding noise
-
Mask from Fong et al.:Interpretable Explanations of Black Boxes by Meaningful Perturbation (ICCV 2017)
-
GradCam from Selvaraju et al.: Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization (ICCV 2017)
-
GuidedBackpropGrad from Springenberg et al.:Striving for Simplicity: The All Convolutional Net (ICLR 2015)
Installation
Library dependencies for the Pytorch-iAlgebra. Before installation, you need to install these with
$ pip install -r requirements.txt
Then Pytorch-iAlgebra can be installed by:
$ pip install pytorch-ialgebra
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file pytorch_ialgebra-1.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: pytorch_ialgebra-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8811313b615969963f190ad3e9ef1b869fefb051dc2ec1939bff4b0477af0cf5 |
|
MD5 | 90b3ae0622c69cf21a91504ecd927493 |
|
BLAKE2b-256 | 89122fa3195c26bd7b4dd3bbb55df51299801ebba4d10b2abe8e751778e8a9c4 |