tensorflow / tcav

Code for the TCAV ML interpretability project
Apache License 2.0
633 stars 150 forks source link

How to use TCAV with custom keras models(h5) #106

Closed dsvrsec closed 3 years ago

dsvrsec commented 3 years ago

Is it possible to use TCAV with custom keras models(h5).If so,Can you please provide the reference notebook or mention where the changes need to be made w.r.t Run TCAV notebook present in the repository.Thank you.

jameswex commented 3 years ago

The current TCAV implementation is built around TF 1.x style models with graphs/sessions so it isn't set up for custom keras models.

That being said, the https://github.com/PAIR-code/lit/ project has been working on a more generic TCAV implementation in its code base (currently just on the dev branch, but soon to be merged to main) to handle any model, provide you write a model wrapper to have your custom model fit the API expected by the LIT tool and the TCAV module there. That might be a direction to go in as that tool's use of TCAV develops.

dsvrsec commented 3 years ago

Thank you