Seq2Seq with Attention

论文:
官方实现:Neural Machine Translation with Attention
李宏毅视频讲解:Attention based model

传统的的Seq2Seq,他的Decoder 部分输入是:Encoder的ouputstate以及一个zero,如下图所示,这在翻译长文本的时候可能导致部分记忆的丢失,作为改进,大神引入了一个Attention机制。
Seq2Seq with Attention

Attention机制就是添加一个输入和输出的匹配值作为Encoder的输入。如下图所示,可以在翻译的时候有着重点。
Seq2Seq with Attention
Seq2Seq with Attention