albermax / innvestigate

A toolbox to iNNvestigate neural networks' predictions!
Other
1.26k stars 233 forks source link

Implmentation of the gamma-rule #249

Closed hasoweh closed 3 years ago

hasoweh commented 3 years ago

My issue is that it seems that the gamma rule is not implemented? This rule is often mentioned in papers and is also recommended as the optimal rule for certain neural net layers, but I have been unable to decipher which of the rules offered in this package can be used for the gamma rule. Thus I find it a bit hard to believe that this rule has not been included in this package. But if that is the case, are there any plans on implementing it in the near future? If this rule has indeed been implemented in this package then please improve the documentation so that future users can find out which one it is.

HugoTex98 commented 3 years ago

I have the same doubt @SevenFoldDeep! Also, I would like to know if there is any way to implement LRP composite in the toolbox?

hasoweh commented 3 years ago

Yes I was also unsure of how to apply a composite of rules. I guess there is likely a way to accomplish this but it is not clear from the documentation or examples. I will likely look into figuring it out myself in the next week or so and let you know if I figure it out.

HugoTex98 commented 3 years ago

Thanks @SevenFoldDeep I'll do the same, since I'm involved in a project that is using this toolbox.

adrhill commented 3 years ago

Hi @SevenFoldDeep ,

LRP-gamma is currently implemented in the updates_towards_tf2.0 branch of iNNvestigate. For the TF2.0 release, it will be merged into master.

For custom LRP composites, you can create a LRP analyzer using the kwargs rule, input_layer_rule, until_layer_rule and bn_layer_rule. You can find individual rules here. It might be helpful to first read the Introduction to development to get a feeling for how iNNvestigate works under the hood.