image.png
image.png
image.png
image.png
li feifei ](https://img.haomeiwen.com/i18072991/8c05bbf60504a96b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
.加入注意力机制: Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
将输入序列编码成语义特征hnhn再解码,但是因为hnhn的长度限制,会使得对于长句的翻译精度降低,论文《Neural machine translation by jointly learning to align and translate》提出了一种Attention机制,不再使用统一的语义特征,而让Decoder在输入序列中自由选取需要的特征,大大提高了Encoder-Decoder的模型性能。《Show, Attend and Tell: Neural Image Caption Generation with Visual Attention》利用Attention机制对原来的Encoder-Decoder机制进行改进。具体的就是利用CNN的空间特性,给图片的不同位置都提取一个特征,有了含位置信息的特征,Decoder在解码时拥有在这196个位置特征中选择的能力,这就是Attention机制。下图展示了一些例子,每个句子都是模型自动生成的,在图片中用白色高亮标注了生成下划线单词时模型关注的区域:
image.png
网友评论