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

How to visualize the attention map of t2t-vit? #20

Closed
Salen158 opened this issue Feb 22, 2021 · 4 comments
Closed

How to visualize the attention map of t2t-vit? #20

Salen158 opened this issue Feb 22, 2021 · 4 comments

Comments

@Salen158
Copy link

The refered example file was using vit, which provided attention weights output. But the t2t-vit model only have logists output, so i can't reuse their code. I really wish a more detaild way to visualize the attention map of t2t-vit. It's really important to me.
thx a lot

@yuanli2333
Copy link
Collaborator

Hi, you can also run our t2t-vit by exacting the attention weights from our pretrained models in each layers. We have released the pretrained weights for each t2t-vit model.

@Salen158
Copy link
Author

Hi, you can also run our t2t-vit by exacting the attention weights from our pretrained models in each layers. We have released the pretrained weights for each t2t-vit model.

thx a lot. I have done it successfully.

@bayesandblues
Copy link

@Salen158 I'm also very interested in this functionality - any chance you have a simple notebook example you're willing to share?

@Salen158
Copy link
Author

@Salen158 I'm also very interested in this functionality - any chance you have a simple notebook example you're willing to share?

u can modify the trainsformer_block.py and t2t_vit.py in models folder to grab and returen the attention weights in forward propagation

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