Pytorch Smoothgrad Save

SmoothGrad implementation in PyTorch

Project README

SmoothGrad implementation in PyTorch

PyTorch implementation of SmoothGrad: removing noise by adding noise.

Vanilla Gradients SmoothGrad Guided backpropagation Guided SmoothGrad

And other techniques such as the following are implemented.

Download

git clone https://github.com/pkdn/pytorch-smoothgrad

Usage

Save the saliency maps using VanillaGrad, GuidedBackpropGrad, SmoothGrad, GuidedBackpropSmoothGrad.

python saliency.py --img <image-path>

Save the Grad-CAM image.

python grad_cam.py --img <image-path>

If you do not specify an image path, read the raccoon's data (scipy.misc.face()).

Requirements

  • PyTorch
  • torch-vision
  • numpy
  • scipy
  • OpenCV

Environment under Python 3.5.2 is tested.

Acknowledgments

This code is insipired by pytorch-grad-cam.

Open Source Agenda is not affiliated with "Pytorch Smoothgrad" Project. README Source: pkmr06/pytorch-smoothgrad
Stars
164
Open Issues
3
Last Commit
3 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating