Two types of classification: binary & Multi-Class
The following are two types of classification problems (one is binary classification, one is Multi-Class classification)
If it is a binary classification classification problem, then the output layer has only one node (1 output unit, SL =1), hθ (x) is a real number,k=1 (K represents the node number in the output layer).
Multi-Class Classification (with K categories): hθ (x) is a k-dimensional vector, SL =k, generally k>=3 (because if there are two classifications, we do not have to use the One-vs-all method, using binary Classification, only one output unit is required).
The cost function of the neural network
The cost function in the neural network is similar to the general logistic regression problem we described earlier, and the difference is that K classes are accumulated, and hθ (x (i) k) is the k element of the K-dimensional vector, the latter regularized term, All θ is added (except for the θ above the bias unit), which is similar to the regularization of the logistic regression we described earlier θ0.
Neural Networks (8)---How to find the parameters of neural networks: the expression of cost function