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

The specific practice of visualization of TEMPORAL Attention Features #14

Closed
lyzcool opened this issue Dec 4, 2024 · 4 comments
Closed

Comments

@lyzcool
Copy link

lyzcool commented Dec 4, 2024

Hello author, your excellent work has inspired me a lot. I have a question about how you visualize TEMPORAL Attention Features. If possible, could you please provide the code? Thank you very much!

@Gjmustc
Copy link

Gjmustc commented Dec 23, 2024

I also have the same doubt. The temporal attention visualization I have tried myself is a diagonal band without a clear outline of the video subject. Can you share the code for visualizing the attention map? It would be highly appreciated!

@wren93
Copy link
Contributor

wren93 commented Dec 23, 2024

Hi, for each patch in each frame, we visualize the average attention score across all attention heads and all tokens (i.e. average
attention weights for all other tokens attending to the current token). So for temporal attention, this average score is computed across 16 tokens at the same spatial position along the temporal dimension. Sorry I no longer have the visualization code.

@Gjmustc
Copy link

Gjmustc commented Dec 25, 2024

Thank you for your timely reply! I also want to know why the spatial attention scores in the I2VGen-XL backbone is all low. Is there any other method to obtain a visualization result of the cross-attn or spatial-attn probability distributions?

@wren93
Copy link
Contributor

wren93 commented Dec 27, 2024

It's not all low, it contains very high values at 1 or 2 positions (as shown by the white dots in the figure). You can take the cross attention and spatial attention weights and draw a box plot or histogram for visualization.

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