Understand RNN in two minutes

This article refers to Mr. Li Hongyi's online class to give my own understanding.

1. RNN

The advantage of RNN is that it has a memory function, which can affect the output at this moment according to the input at the previous moment. The moments in this sentence can be seen in a broad sense. Different words in a sentence are equivalent to different moments, and different frames of a picture can also be regarded as different moments.
insert image description here
I think this picture is the best picture to understand RNN.
To be clear: (I think you can understand RNN by knowing these points)
1. x 1 , x 2 , x 3 x_{1}, x_{2}, x_{3}x1x2x3are three words in a sentence, y 1 , y 2 , y 3 y_{1}, y_{2}, y_{3}y1y2y3is the output obtained by inputting these three words into the network.
2. Each green block is the same network, not three different networks. The three green blocks represent the same network at three moments.
3. The memory block will store x 1 x_{1}x1The memory information output in the green block a 1 a_{1}a1, this memory information works together with the next word to output memory a 2 a_{2}a2y 2 y_{2}y2.
4. The green block contains many neurons but is ignored as a block.
5. The green block is called the hidden layer, ai a_{i}aigive yi y_{i}yiThe biggest difference is that the former does not pass the activation function.
6. The weight W of the memory block is constant in each word, and is only updated once in each sentence.

Then through these 6 points, we can know that RNN is a network with memory, and different words are output in sequence after cycling in this network .

insert image description here
I believe that this minimalist diagram can be understood through the above five points. In the same network , the vectors in Input are input sequentially , and each input is accompanied by an output and a memory. This memory will affect the output value of the next vector.

Guess you like

Origin blog.csdn.net/xiufan1/article/details/122465781