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

Issue with get_gradients when using provided examples #89

Open
jameswex opened this issue Oct 1, 2020 · 5 comments
Open

Issue with get_gradients when using provided examples #89

jameswex opened this issue Oct 1, 2020 · 5 comments

Comments

@jameswex
Copy link
Collaborator

jameswex commented Oct 1, 2020

Model get_gradients code was changed to accept optional examples, for cases where the raw examples are needed to calculate gradients (such as BERT models). All our current demos don't use the optional examples provided, so there is no effect of the bug described below on our existing demo uses.

But, the examples provided are not the correct examples that align with the activations provided, so if someone were to use the examples in get_gradients, they would get incorrect calculations.

The root case is that the activations are generated with a shuffled set of concept examples, and then a different shuffled set of concept examples are loaded (since get_examples_for_concept shuffles by default) for passing to get_gradients (because the initial set used to calculate the activations isn't saved anywhere currently).

@BeenKim FYI

@amoldwin
Copy link

amoldwin commented Jun 1, 2021

Hi James, can you clarify why BERT models need the raw examples in order to calculate gradients rather than just the activations from a given bottleneck?

@jameswex
Copy link
Collaborator Author

jameswex commented Jun 3, 2021

@BeenKim do you remember the reason?

@BeenKim
Copy link
Contributor

BeenKim commented Jul 6, 2021

I think the BERT adoption was written by some folks at Google (tho maybe @jameswex is referring to some external case?), and I am not sure why-my best guess is that they wanted to investigate a directional derivative of a particular example (to use it for some other purpose). I could be wrong.

@BeenKim BeenKim closed this as completed Jul 6, 2021
@BeenKim BeenKim reopened this Jul 6, 2021
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

4 participants
@BeenKim @jameswex @amoldwin and others