Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with keras embedding layers #108

Open
zkysfls opened this issue Jul 8, 2020 · 2 comments
Open

Deal with keras embedding layers #108

zkysfls opened this issue Jul 8, 2020 · 2 comments

Comments

@zkysfls
Copy link

zkysfls commented Jul 8, 2020

I was trying to use DeepLIFT to analyse my text classification model but it will throw key error about embedding layers since there is no key about embedding in layer_name_to_conversion_function function. So it is impossible to use DeepLIFT to model that use keras embedding layers?

@akundaje
Copy link

akundaje commented Jul 8, 2020 via email

@AvantiShri
Copy link
Collaborator

Another thing that could be done is to subset the model to only include the layers that come after the embedding layer, and then supply the output of the embedding layer as the input to this subsetted model. This would give you the importance scores at the level of the embedding layer, which could then be mapped back to the individual words. But it would be worth checking that the architecture of the model after the embedding layer is supported by this deeplift implementation; if the architecture is not supported, then the shap library’s implementation of DeepLIFT would probably be the better way to go as Anshul said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants