Open chenghong-lin-nu opened 6 years ago
RNN可以解决传统神经网络对于文本的问题。它们是network,并且里面有loop,从而能够使得information可以persistent(持久)。
上面是神经网络的一部分,A接收一个输入Xt,然后产生一个输出ht。
A loop allows information to be passed from one step of the network to the next.
循环允许信息从网络的一个部分传到另一个部分。
也就是说循环可以让RNN分批次读取inputs,然后学习;然后再把当前学到的东西利用循环传递给下一个RNN;
LSTM = Long Short Term Memory networks
它是RNN的一种,capable of learning long-term dependencies.
Remembering information for long periods of time is practically their default behavior, not something they struggle to learn!
所有的RNN都有一个chain of repeating modules of a neural network
在标准的RNN中,这个repeating modules有一个十分简单的结构,(例如单个的tanh layer)。
LSTM网络也有chain like structure,但是repeating module有不同的结构。它不是单个的神经网络层,而是有4个,并且互相交互。
了解一下我们将会使用到的注释。
每一条线包含了一个完整的vector;粉红色的圆圈代表了计算的操作;黄色的方框是学习的神经网络层;一条线分叉的话就说明它的内容被拷贝了,然后拷贝的东西走到不同的位置去。
It looks at ht−1 and xt, and outputs a number between 0 and 1 for each number in the cell state Ct−1. A 1 represents “completely keep this” while a 0 represents “completely get rid of this.”
This has two parts. First, a sigmoid layer called the “input gate layer” decides which values we’ll update. Next, a tanh layer creates a vector of new candidate values, C~t, that could be added to the state. In the next step, we’ll combine these two to create an update to the state.
First, we run a sigmoid layer which decides what parts of the cell state we’re going to output. Then, we put the cell state through tanh (to push the values to be between −1 and 1) and multiply it by the output of the sigmoid gate, so that we only output the parts we decided to.
Embeddings are just a shortcut for doing this matrix multiplication.
Embedding其实就是前面Andrew讲的矩阵乘法的便捷方式,就是如果其他都是0,只有一个是1,然后乘以weights矩阵的时候就不用真的去做乘法,而是可以就直接读取那一行就可以了。
embedding lookup 我们把weight matrix作为一个lookup table. 我们把所有的words都编码成为数字,然后要用的时候直接找对应words的序号就可以了。
for example "heart" is encoded as 958, "mind" as 18094. Then to get hidden layer values for "heart", you just take the 958th row of the embedding matrix.
embedding dimension:the number of hidden units
Start off as a generalist, try out a few things, and if you really like an area, become an specialist in that.
Intro to Recurrent Neural Networks
Intro to RNN(循环神经网络)
LSTMs(长短期记忆)
字符RNN
序列分批