2、Additive attention论文:Neural Machine Translation By JointlyLearning to Align and Translate论文链接:https://arxiv.org/pdf/1409.0473.pdf下面有对这篇论文中的attention实现过程详细介绍,这里不做介绍 3、Location-Baseattention、General attention、Dot-Productattention论文:Effective Approaches toAttention-based Neural Machine Translation论文链接:https://arxiv.org/pdf/1508.04025.pdf下面有对这篇论文中的attention实现过程详细介绍,这里不做介绍 4、ScaledDot-Product attention论文:Attention is all you need论文链接:https://arxiv.org/pdf/1706.03762.pdf大家熟悉的Transformer中提到的Attention机制,下面有介绍 三、Attention发展历程及演变1、seq2seq中引入attention机制首先attention机制常用在seq2seq模型中,下图一是传统的seq2seq,输出y对输入序列x1,x2,x3...没有区分,没有辨识度,下图二中我们引入了attention机制,每个输出的词y受输入X1,X2,X3...影响的权重不同,这个权重便是由Attention计算,因此可以把Attention机制看成注意力分配系数,计算输入每一项对输出权重影响大小
(Learning Phrase Representations using RNN Encoder–Decoderfor Statistical Machine Translation论文截图)
(NEURAL MACHINE TRANSLATION BY JOINTLY LEARNING TO ALIGN ANDTRANSLATE论文截图) 介绍一下上图中attention实现过程(1) 首先利用双向RNN结构得到隐层状态(h1, h2, …, hn)(2) 如当前已经decoder到隐层St-1,接下来计算每一个输入位置hj对当前位置i的影响