thuiar / Cross-Modal-BERT

CM-BERT: Cross-Modal BERT for Text-Audio Sentiment Analysis(MM2020)
103 stars 25 forks source link

About the Visualization of the attention matrices. #20

Open BaiMeiyingxue opened 1 year ago

BaiMeiyingxue commented 1 year ago

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')