jacobgil / pytorch-grad-cam

Advanced AI Explainability for computer vision. Support for CNNs, Vision Transformers, Classification, Object detection, Segmentation, Image similarity and more.
https://jacobgil.github.io/pytorch-gradcam-book
MIT License
10.24k stars 1.54k forks source link

Using GradCAM for a decoder #519

Open jcjlin opened 2 months ago

jcjlin commented 2 months ago

Hi, I'm trying to use GradCAM in an autoencoder to visualize the feature map of each layers from the encoder and decoder, I successfully got the image from encoder, but for decoder because the input is a tensor but not image, is it avalible to use GradCAM to visuallize a decoder's feature map?

jacobgil commented 1 month ago

Yes it should work ! As long as the tensor has spatial dimensions (width and height). What are the dimensions of the input tensor ?