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

Add attention scores of the vit encoder as an additional return value #2192

Conversation

dennisrall
Copy link
Contributor

This adds the vit's attention scores as return values.

@dennisrall dennisrall changed the title Add attention scores of the vit as an additional return value Add attention scores of the vit encoder as an additional return value Jun 24, 2022
@github-actions
Copy link

github-actions bot commented Jun 24, 2022

Unit Test Results

       5 files  ±0         5 suites  ±0   1h 52m 50s ⏱️ + 7m 36s
2 908 tests ±0  2 862 ✔️ +1    46 💤 ±0  0  - 1 
8 556 runs  ±0  8 437 ✔️ +1  119 💤 ±0  0  - 1 

Results for commit f4b4f20. ± Comparison against base commit 8fabdae.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@justinxzhao justinxzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dennis-Rall thanks for putting this change together.

Are there any speed implications with outputting attentions?

If so (or if you aren't sure), I suggest that we add this as a parameter in the constructor of the encoder such that this parameter would be configurable.

Please let me know if what I'm requesting is not clear.

@dennisrall
Copy link
Contributor Author

@justinxzhao I don't know how this affects speed, but I think it's definitely a good idea to add this as a configurable parameter.

@dennisrall dennisrall force-pushed the return-attention-scores-in-vit-encoder branch from f0178b8 to 4881dbf Compare June 25, 2022 14:23
@dennisrall
Copy link
Contributor Author

Are the failing hyperopt tests a result of my changes?

@justinxzhao
Copy link
Collaborator

Are the failing hyperopt tests a result of my changes?

Nope! Tests look good, thanks for the PR -- merging.

@justinxzhao justinxzhao merged commit 8cc5b44 into ludwig-ai:master Jul 8, 2022
abidwael pushed a commit that referenced this pull request Jul 11, 2022
…#2192)

* Add returning of attention scores in the vit encoder

* Add output_attentions as a configurable parameter
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

Successfully merging this pull request may close these issues.

None yet

2 participants