Public Course address:Https://class.coursera.org/ml-003/class/index
INSTRUCTOR:Andrew Ng
1. Non-linear hypotheses (
Non-linear hypothesis )
All of the above is about regression. Now we have to start a new topic.-Neural Networks. Naturally, a question arises in the mind. Why should we introduce neural networks?
Considering the housing price prediction problem, we can introduce multiple features to make the prediction more accurate, but we know that there are not many features that can be introduced. If the number of features increases, for example, from100*100ItemsPixelsSelect AllXixjAsA logical regression parameter, then there is a total5*10 ^ 7ItemsFeature. If we use the previous linear hypothesis, it will be very costly to process so many features. Therefore, we have introduced non-linear assumptions to deal with high-dimensional data. Non-linearity refers to the relationship between two variables, which is not a simple proportional (linear) relationship.
For a model that distinguishes whether the image is a car, we can see that if we use a linear hypothesis to select the pixels in the image, thenXRepresents2500Dimension vector,XixjYes300Tens of thousands of features, too costly. If a non-linear hypothesis is used, as shown in the left figure, two pixels can construct a model to determine whether the model is a car or not.
2. Neurons and brain (
Neurons and Brain )
To introduce neural networks, we should first introduce the human brain. As for the human brain, we all know that there are areas dedicated to visual, auditory, and taste, as shown in the following figures:
It is enough to have a basic understanding of the human brain, and brain science is too advanced.
3. Model Representation one (
Model Representation 1)
It's still the human brain, but now we focus on neurons in the human brain:
We can see that the neurons are composed of a number of neurons, such as a number of neurons, and each other, but we only need to know that the neurons receive external stimulus signals and then generate an output. Abstract representation:
There are three inputs, one output, and the yellow circle in the middle represents neurons. Considering that each neuron has a threshold value, output is generated only when the threshold value is exceeded. To simplify the process, we add an additional input to this condition,X0The value of the newly added input is constant1,Theta0For the weight of the edge, the two values are multiplied by the threshold value. For multi-layer scenarios, we can add an additional input in the input and middle layers:
Now we have figured out the basic structure of the neural network. The following is a question about how to calculate it:
No additional input is marked, but it is used in the calculation process. The calculation process is to multiply the input by the corresponding weight,AIs the activation value, which indicates the output of a node. Note thatTheta.
4. Model Representation two (
Model Representation 2)
We can express the above calculation process in the form of vectoring:
The right side is the expression of vectorization, which simplifies writing. For Neural Networks with more layers, the calculation method is similar:
5. Examples and intuitions one (
Intuitive example 1)
Here we use a neural network to implement a simple example, and the operation:
As you can see, the input isX1, x2, The input edge weight is20,-30Is the threshold value, and the output is the summation of the three values.SigmoidFunction. By entering different values in the truth table, we can see that the calculated value is close to the value obtained through logical operations, we can think that this neural network implements the calculation of two inputs and. The following or operations are similar:
6. Examples and intuitions one (
Intuitive example 2)
The following is a more complex example., X1 xnor X2, Translation is the same or gate. First, we need to know:
X1 xnor X2 = (X1 and x2) or (not X1) and (not x2 ))Next, you can first find the neural network of each part, and then splice it. First, noNotOf:
Then there are other parts:
You can intuitively find the implementation at the bottom leftXnorThe neural network of is the superposition of the above three neural networks.
7. multi-class classification (
Multiclass classification problems )
Previously, we mentioned in logistic regression that we need to construct multiple functions to solve the multiclass classification problem. Each function can only be divided into one class. Now with a neural network, we only need to set multiple output units based on the number of categories, and then determine whether the corresponding output unit is1Because each output has only one unit1To mark the category information.
There are four output units. The first output is1Indicates a pedestrian, and the second output is1Indicates a car, and so on.
-------------------------------------------------Weak split line--------------------------------------------------
This lecture mainly introduces the concept of neural networks, we can see that non-linear problems can be solved with them. Compared with linear regression and logistic regression, the neural network is more intuitive and simpler. You only need to set the structure and parameters of the neural network and provide input for output. Of course, these are just the simplest knowledge of neural networks, and there are other more important aspects to learn.