utkuozbulak / pytorch-cnn-visualizations

Pytorch implementation of convolutional neural network visualization techniques
MIT License
7.81k stars 1.49k forks source link

Vanilla Gradient as heat map #75

Closed uzair-mehmood-storex closed 4 years ago

uzair-mehmood-storex commented 4 years ago

Great work, I highly appreciate your work and it helps me alot in my reaearch. I have been exploring your techniques and code and want to ask you that, is there any way to render vanilla gradients as heatmap?

utkuozbulak commented 4 years ago

Hey, I'm glad it was useful for you.

You can simply pass grayscale values to colormap and get similar heatmaps but if you do it that way, I'm pretty sure it will look jittery (not as smooth grad-cam, quick drops from high to low value and vice versa). Maybe try applying smoothing to the saliency map and then applying colormap. I think that would do it.

uzair-mehmood commented 4 years ago

Great, Thanks. Well, can I get heat maps which shows the behavior of gaussian, just like grad cam. Even after smoothing its quite jittery

utkuozbulak commented 4 years ago

You can smooth harder with bigger kernels. I personally didn't try smoothing so not sure what kind of stuff you will get.