美文网首页
《End-To-End Memory Network》阅读笔记

《End-To-End Memory Network》阅读笔记

作者: best___me | 来源:发表于2017-11-17 11:44 被阅读0次

    论文链接:http://machinelearning.wustl.edu/mlpapers/paper_files/NIPS2015_5846.pdf

    本文提出一个端对端的memory network,是端对端训练的,所以在训练时需要很少的supervision。本文的方法也可以看作是RNNsearch的扩展。


    Introduction:

    在AI研究中的两个挑战是

    1. 构建可以进行多步计算的模型,在qa或完成一个任务中

    2. 可以描述序列数据的长期依赖的模型

    最近出现的是使用storage和attention,操作这个storage为这些挑战提供了一个方法。storage是一个连续的表示,从storage中读取和写入,通过神经网络建模。

    本文提出一个RNN结构的模型,在输出之前循环的从external memory中读取,本文的模型也是一个Memory Network[1]的连续型版本,Memory Network不容易BP,每层都需要supervision。本文的模型可以端对端的训练,有输入-输出。本文的模型同样可以看做是RNNsearch[2]的一个版本,有多个计算步骤。多步的计算可以提高performance


    Approach:

    输入x1,..., xn,存储在memory中,一个query q,输出a  。

    每个xi,q和a都包含来自字典V的象征。模型将x写入到memory中,有一个固定长度的buffer size,然后找到x和q的连续性representation。连续性表示通过多跳处理到输出a。

    2.1 Single Layer

    单层memory hop:

    input memory representation:x1,...,xi,

    将xi转换为mi,mi是d维的,使用embedding matrix A,d*V

    另一个embedding matrix B,和A维度相同,来embedded query q,获得一个internal state u。

    使用embedding space来计算u和每个memory mi的匹配程度,计算内积,然后接一个softmax。

    Output memory representation

    每个xi都有一个output vector ci,(另一个embedding matrix C),来自memory的reponse vector o是输入ci的求和

    从memory拿到的response vector

    Generating the final prediction

    将output vector o和input embedding u求和,W权重矩阵是V*d的

    predicted label

    三个embedding matrices A,B 和C,以及W权重矩阵是联合训练的,通过最小化standard cross-entropy loss between predicted label and the true label a。用随机梯度下降训练。

    2.2 Multiple Layers

    公式4

    每层都有自己的embedding matrices Ak,Ck。但是它们是会限制训练并且增加参数个数。

    使用两种权重方案:

    Adjacent和Layer-wise(RNN-like)

    Overall, it is similar to the Memory Network model in [1], except that the hard max operations within each layer have been replaced with a continuous weighting from the softmax.

    如果使用Layer-wise方案,模型可以转换为传统RNN,只是将RNN的输出分为internal和external的输出。(感觉这里作者说的很容易帮助理解,太厉害了,还是要多读好论文啊)

    Emitting an internal output corresponds to considering a memory, and emitting an external output corresponds to predicting a label.

    从RNN的角度,在图1(b)中的u和公式4中的是hidden state,这个模型生成一个internal output p(attention权重,在图1(a)中使用A)。ingest p using C,然后更新隐状态。而与RNN不同的是,在K hops中输出是存储在memory中的,keep these outputs soft, rather than sampling them(懵逼+_+,soft是啥)

    The goal in language modeling is to predict the next word in a text sequence given the previous words x.

    [1] https://arxiv.org/pdf/1410.3916.pdf

    [2] http://web.stanford.edu/class/cs224d/papers/neural_machine.pdf

    相关文章

      网友评论

          本文标题:《End-To-End Memory Network》阅读笔记

          本文链接:https://www.haomeiwen.com/subject/nkhhvxtx.html