RNN basics explains why RNN is needed

Neural network foundation

The neural network can be regarded as a black box that can fit arbitrary functions. As long as the training data is sufficient, given a specific x, the desired y can be obtained. The structure diagram is as follows:

Introduction to RNN Basics Why RNN is needed

After training the neural network model, given an x ​​in the input layer, you can get a specific y in the output layer after passing through the network. So, with such a powerful model, why do you need RNN (Circular Neural Network)?

2. Why do you need RNN (Circular Neural Network)?

They can only handle the input one by one, and the previous input and the last input are completely unrelated. However, some tasks need to be able to better process the sequence information, that is, the previous input and the subsequent input are related.

For example, when we understand the meaning of a sentence, it is not enough to understand each word in isolation. We need to deal with the whole sequence of these words. When we process the video, we can't just go alone. Analyze each frame and analyze the entire sequence of connections of these frames.

In the simplest part of speech tagging task of nlp, I will eat three words of apple to mark the part of the word for me / nn eat / v apple / nn.

Then the input to this task is:

I eat apples (sent sentences that have been segmented)

The output of this task is:

I /nn eat /v apple /nn (words marked with good words)

For this task, of course, we can directly use the ordinary neural network to do the training data format for the network is me - "I / nn such a single word -" word-of-word marked words.

But obviously, in a sentence, the previous word actually has a great influence on the part-of-speech prediction of the current word. For example, when predicting apple, because the previous eating is a verb, it is obvious that the probability of apple as a noun will be great. The probability of a verb is very common because the verb is followed by a verb, and the verb following the verb is rare.

So in order to solve some of these similar problems and better handle the sequence information, RNN was born.

3.RNN structure

First look at a simple cyclic neural network, which consists of an input layer, a hidden layer, and an output layer:

Introduction to RNN Basics Why RNN is needed

I don't know if the beginners can understand this picture. Anyway, when I first started learning, it is very aggressive. Each node represents a value input, or a layer of vector node collection. How to hide the layer? Can connect to yourself, and so on. These figures are a more abstract picture.

We now understand that if the circle with the arrow above W is removed, it becomes the most common fully connected neural network.

x is a vector that represents the value of the input layer (the circle that is not drawn to represent the neuron node); s is a vector that represents the value of the hidden layer (here the hidden layer draws a node, you can also imagine this A layer is actually a plurality of nodes, and the number of nodes is the same as the dimension of the vector s);

U is the weight matrix of the input layer to the hidden layer, o is also a vector, which represents the value of the output layer; V is the weight matrix of the hidden layer to the output layer.

So now let's see what W is. The value s of the hidden layer of the cyclic neural network depends not only on the current input x but also on the value s of the last hidden layer. The weight matrix W is the weight of the last value of the hidden layer as the input of this time.

We give the concrete map corresponding to this abstract map:

Introduction to RNN Basics Why RNN is needed

We can clearly see from the above picture how the hidden layer of the last moment affects the hidden layer of the current moment.

If we expand the above diagram, the circular neural network can also be drawn like this:

Introduction to RNN Basics Why RNN is needed

It now seems clear that after the network receives the input at time t, the value of the hidden layer is, the output value is. The key point is that the value depends not only on, but also on. We can use the following formula to represent the calculation method of the cyclic neural network:

Formulated as follows:

Introduction to RNN Basics Why RNN is needed

4. Summary

Well, here I will explain some of the most basic knowledge points of RNN, which can help you to feel the RNN intuitively and understand why you need RNN, and then summarize its reverse guidance knowledge points.

Finally, give an overview of the RNN:

Introduction to RNN Basics Why RNN is needed

N Connector

Series N type connect are widely used in communication systems. which have the excellent performances of virbration prooff, high reliability, uperior electrical and mechanical propertie.

We produce all kinds N type, for Semi-rigid connctors, Straight Cable plugs, Right Angle Cable Plug, Straight Flange Jacks and Plugs.

The interface dimensions and technical characteristices are in accord with the specifications of MIL-STD-348A-304, IEC 60169-16 and CECC 22210.

N Type Cable Mount Connectors,N Type Bulkhead Mount Connectors,N Type Flange Mount Connectors,N Type PCB Mount Connectors

Xi'an KNT Scien-tech Co., Ltd , https://www.honorconnector.com

Posted on