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

Preprocessing function argument needed? #126

Open michaelsok opened 4 years ago

michaelsok commented 4 years ago

Hi, and thanks for the work on interpretability!

It may be a dumb question, but shouldn't the methods like OcclusionSensitivity, SmoothGrad and any interpretability method which use modified inputs have a preprocess_function argument? I mean, technically, the preprocessing may be a step before the model (such as the preprocess function in keras for VGG-16) but change the distribution of the images. And usually images are normalized, so applying a grey patch on them (for OcclusionSensitivity) does not make sense (for instance, if we have pixels with range between 0 and 1, the grey patch gives images with pixels equal to 127.5).

So I think a preprocess argument may be needed when a model relies on it before training, but I may have missed something.

In all cases, thanks for the hard work!