注意力机制---Attention、local Attention、self Attention、Hierarchical attention

2022-12-19,,,

一、编码-解码架构

目的:解决语音识别、机器翻译、知识问答等输出输入序列长度不相等的任务。

C是输入的一个表达(representation),包含了输入序列的有效信息。

它可能是一个向量,也可能是一个固定长度的向量序列;
如果C是一个向量序列,则它和输入序列的区别在于:序列C是定长的、较短的;而输入序列是不定长的、较长的。

二、注意力机制

1.attention

注意力权重用来估计其他元素与其相关的强度,并将由注意力加权的值的总和作为计算最终目标的特征。

step1:计算其他元素与待测元素的相关性权重;

step2:根据相关性权重对其他元素进行加权求和。

2.local attention

3.self attention(intra attention)

4.Hierarchical attention

参考文献:

【1】深度学习和自然语言处理中的Attention和Memory机制 - 云+社区 - 腾讯云

【2】Attention and Memory in Deep Learning and NLP – WildML

注意力机制---Attention、local Attention、self Attention、Hierarchical attention的相关教程结束。

《注意力机制---Attention、local Attention、self Attention、Hierarchical attention.doc》

下载本文的Word格式文档,以方便收藏与打印。