zqs1022 / interpretableCNN

MIT License
223 stars 52 forks source link

Flipping of masks in the batch and filter dimension #8

Open egnamen opened 2 years ago

egnamen commented 2 years ago

Hi,

I am currently trying to recreate the results in the paper. However, I am unclear on why the mask array is flipped along the batch and filter dimension using END : -1 : 1 in backpropagation. I would appreciate if you could elaborate a bit on why this is done :)

colorfuldarkgray commented 2 years ago

MAy this be the answer to your question...?

https://github.com/zqs1022/interpretableCNN/issues/2

stigaro commented 2 years ago

MAy this be the answer to your question...?

2

I am a bit unsure. It seems to me that the trace operation is working as intended because in the code each mask is hadamard multiplied with each feature map. The problem is more related to how the code seem to completely flip the ordering of masks over batch and filter dimension.

This means that a mask no longer gets multiplied with its corresponding feature map, and it is a bit hard to understand what this flip operation is calculating, especially so since the concepts in the code differ from the paper concepts.

If anyone has an idea about what this part of the code does, or know of sources that explains this process, please share 🙏