attention based model:attention 的计算公式
BahdanauAttention
LuongAttention
global方式
提供了四种获取权重的办法
local方式
BahdanauAttention和LuongAttention结构的不同:
BahdanauAttention是用t时刻产生的context vector去当t+1时刻RNN的输入,LuongAttention使用t时刻产生的context vector和t时刻RNN的输出线性变换后求最后结果。
直接上LuongAttention比较说得通,但是RNN里面一般都是互为因果,相互影响的。