Attention 机制

1. Attention 计算方法

1.1 点乘

$score = a^T * b$

1.2 权值网络映射

$score = a^T W b$

1.3 拼接映射

$score = v^T tanh(W[a, b])$

2 Attention 种类

2.1 Soft Attention And Hard Attention

  • soft attention: 加权平均
  • hard attention: 取最大的一个或者抽样

2.2 Global Attention And Local Attention

  • Global Attention: 全局
  • Local Attention:预测中心点
Donate comment here