软注意力机制关注于区域或者通道,软注意是确定性注意力,是可微的,能够通过训练得到注意力权重。
reshape过程:
theta:view+permute
phi:view
g:view+permute
矩阵乘法:
f = torch.matmul(theta, phi)
软注意力机制关注于区域或者通道,软注意是确定性注意力,是可微的,能够通过训练得到注意力权重。
reshape过程:
theta:view+permute
phi:view
g:view+permute
矩阵乘法:
f = torch.matmul(theta, phi)
相关文章: