utkuozbulak / pytorch-cnn-visualizations

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

how to see saliency maps from middle layers #37

Closed YOONAHLEE closed 5 years ago

YOONAHLEE commented 5 years ago

Hi,

Do you know how to get neuron's saliency map from the middle layer? I want to pick some neurons from the middle layer and compare visualization result but I cannot figure out how to pick values to see an image from lots of gradients.

Thank you,

utkuozbulak commented 5 years ago

Hey,

Just do forward pass until the layer you want to visualize and perform gbp or vbp sourced from there.

ann-bot commented 5 years ago

Hi,

for getting gradients from middle layers after one iteration, like the example mention in ReadMe, how do you forward pass again?

utkuozbulak commented 5 years ago

Hey,

Check layer visualization file, you just modify the input image and forward pass again.

ann-bot commented 5 years ago

Thanks!