Saliency calculation module for Chainer
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.gitignore
LICENSE
README.md

README.md

chainer-saliency

Saliency calculation examples.

Article

From left: 1. Classification saliency map visualization of VGG16, CNN model. 2. iris dataset feature importance calculation of MLP model. 3. Water solubility contribution visualization of Graph convolutional network model.

setup

chainer>=5.0.0

  • Use LinkHook chainer-chemistry master branch
# please update your chainer (version>=5.0.0 is necessary)
pip install -U chainer

# saliency module is available only in master branch (not included in stable version yet)
git clone https://github.com/pfnet-research/chainer-chemistry.git
pip install -e chainer-chemistry

saliency module usage

# model is chainer.Chain, x is dataset
calculator = GradientCalculator(model)
saliency_samples = calculator.compute(x)
saliency = calculator.aggregate(saliency_samples)
 
visualizer = ImageVisualizer()
visualizer.visualize(saliency)

Basically that's all to show saliency plot like top figure!