-
Notifications
You must be signed in to change notification settings - Fork 48
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
Problem of calculating gradient from embedding to word #9
Comments
Embedding layers by definition do not pass gradient through it. The layer uses dictionally lookup from word index to whatever dimension embedding that you decide to use. There is no gradient going back to the indexes themselves. However, there are gradients flowing back to the embedded vectors, so you can sum the attribution to the vectors to get the actual attribution values. At the end of the day, embedding layers are equivalent to fully connected layers with one-hot encoded inputs. |
Thanks, I have modified code to set the start nodes of the network in https://github.com/pl8787/IntegratedGradients. |
Sounds good! |
The model can only get gradient for embedding layer. If the input of the model is word id and use Embedding Layer, the Integrated-Gradients return an error.
However, I can get the gradient of embedding, how to determine the value of single words, for example in paper
Section 6.3
Question Classification?The text was updated successfully, but these errors were encountered: