sicara / tf-explain

Interpretability Methods for tf.keras models with Tensorflow 2.x
https://tf-explain.readthedocs.io
MIT License
1.02k stars 111 forks source link

Gradients*Inputs #90

Closed RaphaelMeudec closed 4 years ago

RaphaelMeudec commented 4 years ago

Explanation

This issue aims at implementing the Gradients*Inputs method.

At the moment, there is only the Vanilla Gradients which is implemented. The difference between Vanilla Gradients (VG) and GradientsInputs (GI) is that instead of returning the pure gradients for a given inputs, it returns the gradients ponderated by the input values.

The operation to perform is to take the input (shape HW3) and the gradients (shape HW3), and multiple each of the 3 channels to obtain the ponderated gradients (shape HW3). From there, we create a visualization (either HW3 or HW1).

How

Part 1: Create the core algorithm

Part 2: Add the corresponding callback

Part 3: Examples, Docs

Checks