Hello everyone, in this series we explore machine learning with neural networks. In particular, so that our neural network recognizes handwritten digits. In this first video I want to introduce neural networks a simple example. Imagine we have two kinds of plants. One with red flowers and the other with purple. And one day we decide to measure the length and width of their petals. For simplicity, I call these properties x1 and x2 Because we have only two properties, we can distribute the data in two dimensions.
We see red and purple flowers created two separate groups. We can draw a line that divides them. This is called "decision boundaries". If we get new data and are on one side of the border, we predict that it is a red flower. On the other hand, it would be purple. We want to calculate this boundary after our neural network. We will start by creating a simple network. It will have two input neurons x1, x2 for our two properties. And two output neurons that show probability, that the flower is red or purple. Then we can join the input neurons with the first output. And the forces (or weights) of these connections will be w1 and w2. Then r, the probability that the flower will be red, is given by the equation x1 times w1 + x2 times w2. We can also connect the second output neuron with input, to calculate p, which is equal to x1 times w3 + x2 times w4. Back to the chart - where r is greater than red and where p is greater than r violet. The weight parameter determines the slope "decision boundaries".
To properly separate red flowers from purple, the boundary must be capable of vertical displacement. Back to our network. Add a slider to each output neuron. Scales and sliders together they can reliably divide the data. However, there is a great limitation. Our boundary is always straight. For this example, this is fine, but now I will show something, what can not be divided by a straight line. For this we will need a more advanced network. We will insert in our network a new layer, called the "hidden layer". We can join the first hidden neuron to the input layer and get a1, equal x1 * w1 + x2 * w2 + b1, which is our old r. We can do the same for the other two hidden neurons, to get a2 and a3. Next, we connect the first output neuron to the hidden layer. We get the output a1 * w7 + a2 * w8 + and a3 * w9 + b4.
The same for the second output neuron. Now we have more scales and sliders, with whom I can play. But I can still just create straight lines. That's because it's all there is we add linear equations, resulting in other linear equations. So we have to find a way to create a nonlinear one. One solution is to use some sigmoid function. You can see this on the screen For small values it is functional value zero, for large values, the value is one. We will connect this to our network by hiding hidden values and the output layer with this function. By the way, this is called activation function. now a change in the weight of a single neuron changes the slope of the activation function and shifting the scroll bar function to the sides. In the graph of the activation function she was able to create a curve. With the right value of scales and sliders can be divided red and purple flowers.
Of course, I now change my values manually, but the sense of the neural network is to arrive at the correct values automatically. You can see it here. Let's see how this works a bit later in this series. For now, it is important to understand, how weights and sliders decide which areas red and blue purple flowers in this example, in order to classify new data, when we do not know where it belongs. Note that we only work with two properties. That is why we work in two dimensions. If we had a third property, it is not difficult to imagine the border or surface, if you want, in three dimensions. With four or more features it's not so easy to introduce yourself, but the concept remains the same. I hope this video helped you understand the structure of the neural network with input, hidden and output layers, weights, sliders and activation functions, and general understanding, what the network is learning to divide, specifically the decision boundary. In the next work, we will create a network in Python, so far, hello..