keisen / tf-keras-vis

Neural network visualization toolkit for tf.keras
https://keisen.github.io/tf-keras-vis-docs/
MIT License
313 stars 45 forks source link

Allow passing arguments to model calls #26

Closed mys007 closed 4 years ago

mys007 commented 4 years ago

Currently, the codebase does not allow to pass arguments to model calls, e.g.

https://github.com/keisen/tf-keras-vis/blob/fdfb61b325fe6f49e7297fc38f37e9f02bfd918f/tf_keras_vis/gradcam.py#L58

This means one cannot influence whether a model is called in inference or training mode, as e.g. data augmentation layers are on by default (https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py#L396) and global setting of learning phase is deprecated (https://www.tensorflow.org/api_docs/python/tf/keras/backend/set_learning_phase). I suggest the training mode be passed as a parameter of e.g. Gradcam.call.

keisen commented 4 years ago

Thank you for your reporting! I will address it immediately.

mys007 commented 4 years ago

Awesome, really great maintenance! Thanks.

keisen commented 4 years ago

You're welcome! BTW, if you would like, please click the Github Stars of this repository.