-
Notifications
You must be signed in to change notification settings - Fork 23
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
Attention map visualization #5
Comments
Hi, Sorry for this late reply. I am doing another project recently. I take the average of the attention map over the head dim and then visualize the attention map with Seaborn. I can upload it later after some simple clearning. |
Thanks for this nice work. I'm also interested with your attention map visualisation, did you use Seaborn heatmap to visualise this after training? I tried to visualise my fully trained attention weights but the outcome failed to show similar texture like the Figure 6 shows in the paper. Could you please share some details of your implementation? |
Hi, thanks for your interest and sorry for the delay on uploading the visualization script. I am doing some other projects. Just a quick reply, I take the average over all heads before visualization and yes, I use seaborn for visualization. With default setting, there are only some white lines along the diagonal and the range keeps increasing with a diagonal center. The more clear visualization need to adjust the contrast settings carefully. Can you please show some examples of your plots? I can help with debugging a little bit hopefully. Later I can also upload mine for comparisons. |
Dear Daquan, |
|
Hi Chaojun, Thanks for your interest and really sorry for this really late reply! You can take a look at this link first where I have uploaded the code for visualization as well as the pretrained model and the saved attention map data in pickle file. I will try to update the README this weekend. https://drive.google.com/drive/folders/1_lxspG_nzPstxDWhKQqPWhYZlB6zPMGs?usp=sharing |
Hi, thanks for your interest. Please check the link for the visualizations. https://drive.google.com/drive/folders/1_lxspG_nzPstxDWhKQqPWhYZlB6zPMGs?usp=sharing |
thank you so much, this code will help me a lot |
Hi, Daquan! I tried the code and .pth.tar file you provided above. However, I got the output visualization for layer 1 like this. |
Please see my reply in another thread. Thanks. |
I notice that you visualize the attention map of selected blocks(in Fig. 6), can you show the code for drawing that?
The text was updated successfully, but these errors were encountered: