External-Attention-pytorch icon indicating copy to clipboard operation
External-Attention-pytorch copied to clipboard

Maybe an error in SKAttention?

Open DocF opened this issue 3 years ago • 1 comments

首先感谢您的工作。 attention_weughts=self.softmax(attention_weughts)#k,bs,channel,1,1 此时attention_weughts 的shape 为 k,bs,channel,1,1,而该softmax应该是 k 这个维度进行。 因此 SKAttention 中 self.softmax=nn.Softmax(dim=1) 是否要改为 self.softmax=nn.Softmax(dim=0) @xmu-xiaoma666 期待您的回复

DocF avatar Jul 15 '21 14:07 DocF

首先感谢您的工作。 attention_weughts=self.softmax(attention_weughts)#k,bs,channel,1,1 此时attention_weughts 的shape 为 k,bs,channel,1,1,而该softmax应该是 k 这个维度进行。 因此 SKAttention 中 self.softmax=nn.Softmax(dim=1) 是否要改为 self.softmax=nn.Softmax(dim=0) @xmu-xiaoma666 期待您的回复

对的,确实写错了,已修改

xmu-xiaoma666 avatar Jul 16 '21 04:07 xmu-xiaoma666