Cross-Modal-BERT icon indicating copy to clipboard operation
Cross-Modal-BERT copied to clipboard

About the Visualization of the attention matrices.

Open BaiMeiyingxue opened this issue 2 years ago • 0 comments

Hi, Thanks for your great project! Here I have a question about the visualization of the attention matrices. Is it right if I use the text_attention and fusion_attention to visualize by the following plot code?

            plt.subplot(2, 1, 1)
            plt.imshow(text_attention[0], cmap='Blues', interpolation='nearest')
            plt.colorbar()
            plt.xlabel('Source')
            plt.ylabel('Target')
            plt.title('Visualization of the Text Attention Matrix')
            plt.subplot(2, 1, 2)
            plt.imshow(fusion_attention[0], cmap='Blues', interpolation='nearest')
            plt.colorbar()
            plt.xlabel('Source')
            plt.ylabel('Target')
            plt.title('Visualization of the Fusion Attention Matrix')

BaiMeiyingxue avatar Aug 26 '23 12:08 BaiMeiyingxue