Closed rachtibat closed 3 years ago
Using "jet" cmap Old zennit:
New Zennit:
Thanks, I'll have a look. Two things first:
__pypackages__
. This makes it much easier to update and keep track of versions.Found the problem, the gradient check in c984127 was only checking for .grad_fn
. In the first layer, there may not be a .grad_fn
yet, thus it should rather check for .requires_grad
. I will prepare a MR.
Hi, Thanks for your suggestions. I tested your fix and it's working great!
Best
Hi,
it is a long time ago, I pulled all the new zennit updates. So I missed a lot of comments and I can not exactly point out where the LRP pipeline seems to have broken down the first time. For test purposes, I always use the same LeNet model pretrained on FashionMNIST. When I generate a heatmap with "epsilon_plus", I get with the old version of zennit the same heatmap as in Innvestigate. But the new version suddenly produces completely different heatmaps.
You can try it out with my code example on https://github.com/rachtibat/mnist_zennit I uploaded for you. Just change the import "zennit_old" to "zennit_new" and you see the difference. I changed the name of zennit.torchvision to zennit.torchvision_2 making it work fast and dirty (; (see https://github.com/chr5tphr/zennit/pull/6)
Do you think, I made a mistake or is zennit somehow computing the heatmaps differently?
Best
P.s. if this is really a bug, it might solve the other issues