你好,请问使用run_grid_attention_example(version=2),产生如下图片,注意力图是彩色波纹,是啥原因,怎么解决?
looker23333 opened this issue · 3 comments
looker23333 commented
rentainhe commented
@looker23333 这是因为里面的一个参数cmap决定的,这是比较好看的一种热力图,红色的值表示attention关注的位置比较高的区域,然后因为默认设置的其实是随机生成的没有归一化后的一个attention map用来举例,所以可能看起来就比较奇怪一点,是正常现象,我之后会增加一个vision transformer的example,会更好看一些
rentainhe commented
这样的图是不是更加直观一些,我已经更新了example.py,主要的区别就是,把随机生成的attention mask给归一化了
looker23333 commented
懂了,谢谢