目录
变为 Element-wise-Attention Gate (EleAttG) 后
论文名称:Adding Attentiveness to the Neurons in Recurrent Neural Networks(2018 ECCV)
下载地址:https://arxiv.org/pdf/1807.04445.pdf
Summary
在以 RNN 为基础的相关结构中,gate 用来控制信息的流动。但作者认为,gate 对信息流的控制是把输入看做一个整体,只关注了当前信息和历史信息的贡献,而没有去挖掘一个时间戳输入里不同元素的不同重要程度。
所以,作者提出在 RNN 相关的结构中加入注意力机制,变为 Element-wise-Attention Gate (EleAttG) 结构,给输入里不同元素赋予不同的重要程度。
其中,注意力机制体现在由当前的输入和隐藏层的状态共同决定输入里每个元素的重要性,形成一个 attention map,用这个 attention map 对当前输入进行重要性程度的更新,再对更新后的输入进行后续 RNN 的操作。
此外,作者设计的 attention map 又与之前的 attention 机制不太一样:之前的 attention 使用 Softmax 函数作为激活函数,这样会导致 attention map 的加和为 1,可能会互相制约每个元素的 response value。而文中使用的是 sigmoid 函数作为激活函数,去除掉了这个加和为 1 的限制。
Details (Implementation)
原来的 RNN 结构
For a standard RNN layer, the output response ht at time t is calculated based on the input xt to this layer and the output ht−1 from the previous time slot
变为 Element-wise-Attention Gate (EleAttG) 后
For an RNN block, we propose an Element-wise-Attention Gate (EleAttG) to enable the RNN neurons to have the attentiveness capability. The response of an EleAttG is a vector at with the same dimension as the input xt of the RNNs, which is calculated as