本文共 2176 字,大约阅读时间需要 7 分钟。
吴恩达 Andrew Ng
Examples
Speech recognition, Music generation, Sentiment classification, DNA sequence analysis, Machine translation, Video activity recognition, Name entity recognition
X(i)<t>: X ( i ) < t > : 第i个输入样本的第t个元素
T(i)X: T X ( i ) : 第i个输入样本的长度
建立字典(单词的列向量),使用one-hot表示单词位置
UNK: unknown word, 表示不在字典里的词
Inputs and outputs can be different lengths in different examples
每个样本的输入输出维度不固定
at each time-step, RNN passes on activation to the next time-step
从左到右依次扫描参数
每个时间步采用的是相同的参数 Wax,Waa,Wya W a x , W a a , W y a
只使用了之前的信息来做出预测
BRNN,双向循环神经网络
a<0>=0 a < 0 > = 0 , a<1>=g1(Waaa<0>+Waxx<1>+ba) a < 1 > = g 1 ( W a a a < 0 > + W a x x < 1 > + b a ) , y^<1>=g2(Wyaa<1>+by) y ^ < 1 > = g 2 ( W y a a < 1 > + b y )
激活函数 g1 g 1 常用 tanh t a n h , g2 g 2 常用 sigmoid,softmax s i g m o i d , s o f t m a x
corpus 语料库、tokenize 标记、End Of Sentence
y^<1> y ^ < 1 > 输出第一个词是XX的概率
给定前面的词,预测下一个词是什么
训练一个序列模型之后,要想了解到这个模型学到了什么,一种非正式的方法就是进行一次新序列采样
character language model, word level language model
基于词汇的语言模型可以捕捉长范围的关系,基于字符的语言模型略逊一筹,并且训练成本比较高昂
c, memory cell, c~<t>=tanh(Wc[c<t−1>,x<t>]+bc) c ~ < t > = tanh ( W c [ c < t − 1 > , x < t > ] + b c ) , c<t>=x<t> c < t > = x < t >
Γu=σ(Wu[c<t−1>,x<t>]+bu) Γ u = σ ( W u [ c < t − 1 > , x < t > ] + b u ) , update gate, this gate value is between 0 and 1
gate decides when to update c, c<t>=Γu∗c~<t>+(1−Γu)∗c<t−1> c < t > = Γ u ∗ c ~ < t > + ( 1 − Γ u ) ∗ c < t − 1 > , element-wise multiplication
update, forget, output
peephole connection 窥探孔连接
combine information from the past, the present and the future
图中的前向传播一部分计算是从左到右,一部分计算是从右到左
对于大量自然语言处理问题,LSTM 单元的双向 RNN 模型是用的最多的
need the entire sequence of data before making predictions
a[l]<t>: a [ l ] < t > : layer l, at time t, activation value