https://github.com/corochann/chainer-saliency
Saliency calculation module for Chainer
https://github.com/corochann/chainer-saliency
chainer deep-learning reasoning
Last synced: 2 months ago
JSON representation
Saliency calculation module for Chainer
- Host: GitHub
- URL: https://github.com/corochann/chainer-saliency
- Owner: corochann
- License: mit
- Created: 2018-12-02T08:49:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-28T05:33:53.000Z (almost 6 years ago)
- Last Synced: 2024-12-30T15:42:53.814Z (4 months ago)
- Topics: chainer, deep-learning, reasoning
- Size: 2.36 MB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chainer-saliency
Saliency calculation examples.
Article
- [Library release: visualize saliency map of deep neural network](http://corochann.com/library-release-visualize-saliency-map-of-deep-neural-network-1478.html)
- [NNの予測根拠可視化をライブラリ化する](https://qiita.com/corochann/items/066dcbfbe04a6bd447a3)
![]()
![]()
![]()
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 : To use `LinkHook`
- chainer-chemistry>=0.5.0 : saliency module is introduced from 0.5.0```bash
# please update your chainer (version>=5.0.0 is necessary)
pip install -U chainer# install chainer-chemistry
pip install -U chainer-chemistry
```# saliency module usage
```python
# 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!