论文阅读:An Empirical Study of Spatial Attention Mechanisms in Deep Networks

1、研究空间注意力机制。

(1)Transformer attention
处理自然语言序列的模型有 rnn, cnn(textcnn),但是现在介绍一种新的模型,transformer。与RNN不同的是,Transformer直接把一句话当做一个矩阵进行处理,要知道,RNN是把每一个字的Embedding Vector输入进行,隐层节点的信息传递来完成编码的工作。简而言之,Transformer 直接粗暴(后面Attention也就是矩阵的内积运算等)。TransFormer 模型使用堆叠的自注意力(self-attention)、逐点(point-wise)、全连接层(fully connected layers).后引入cv任务中。
压缩的点乘注意力机制
输入:查询矩阵Q、键矩阵K、值矩阵V
输出:Attention

论文 Transformer-XL 中提出,注意力权重可以按使用的特征因子被拆解为四项:(E1)query 内容特征和 key 内容特征;(E2)query 内容特征和 query-key 相对位置;(E3)仅 key 的内容特征;(E4)仅 query-key 相对位置。如图所示。
在这里插入图片描述
(2)deformable convolution [10, 52] and dynamic convolution 也是注意力机制

2、方法。试验

(1)统一注意力机制
在此形式下,Transformer、可变形卷积(Deformable Convolution)和动态卷积(Dynamic Convolution)均可被视为空间注意力的不同实例,其区别仅在于如何计算注意力权重 A_m (q,k,z_q,x_k )。我们在此形式下对影响空间注意力机制的各种因素进行了详尽的分析与研究。
在这里插入图片描述
(2)对比
在这里插入图片描述
不同特征因子对Transformer 的性能影响
图3:不同特征因子对 Transformer 的性能影响

3、结论

(1) In self-attention, the query-sensitive terms play a minor role compared to the query-irrelevant terms.
(2) In encoder-decoder attention, the query and key content term is vital.
(3) In self-attention, the attention factors of query content & relative position and the key content only are most important.

Deformable convolution vs. E2 in Transformer attention
(1) For object detection and semantic segmentation, deformable convolution considerably surpasses the E2 term in both accuracy and efficiency。While for Neural Machine Translation (NMT), deformable convolution is on par with the E2 term in both accuracy and efficiency.
(2) The combination of deformable convolution and the key content only term (“0010 + deformable”) delivers the best accuracy-efficiency tradeoff.

Dynamic convolution vs. E2 in Transformer attention
在这里插入图片描述

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值