接上一篇。
Model Architecture
Applications of Attention in our Model,注意力机制在模型中的应用
上一篇讲了文章提出的注意里机制:提出新的一种注意力计算方法Scaled dot-product attention,以及其扩展的multi-head attention。
论文接下来的内容就是说的那张结构图中的三处attention的不同,把那张图再贴过来,便于对比。
-
首先是encoder这边的Multi-Head Attention。论文的原文为:The encoder contains self-attention layers. In a self-attention layer all of the keys, values and queries come from the same place, in this case, the output of the previous layer in the encoder. Each position in the encoder can attend to all positions in the previous layer of the encoder.