Now that we've solved the problem of binary classification, let's talk about the problem of multiple classification
1.Overview of multi-categorical problems
What do we do when binary classification expands into multiple classifications?
2.Softmax regression
Softmax regression is used to solve multi-classification problems and is a generalization of logistic regression.
example:
In summary:
or:
3.Cost function
(1)Cross-entropy loss function
The cross-entropy loss function is also a generalization of multi-class.
(2)The gradient descent method is used to find the minimum
We are able to calculate its minimum value mathematically.
We calculate its gradient:
This gradient is then used to update the parameters.
(3)Regularization
Thus:
4.Neural network with softmax regression
(1)Principle
Outputs a column vector with ten values, a1 to a10, representing the probability of each class.
(2)TensorFlow code
(3) Improve the code