-
构造输出节点,使节点数量与分类类别数目相同。
-
Construct the output nodes to have thesame value as the number of classes.
使用softmax函数作为激活函数。
The softmax function is used as theactivation function.
-
通过1元热键编码将类别名称转换为数字向量,即:
-
Switch thenames of the classes into numeric vectors via the one-hot encoding method.
-
用适当的值初始化神经网络的权值。
-
Initialize the weights of the neuralnetwork with adequate values.
-
将训练数据{输入,正确输出}输入神经网络并获得训练输出。
-
Enter the input from the training data {input, correct output } into the neural network and obtain the output.
-
对所有训练数据点重复步骤4 - 7。
-
Repeat Steps 4 - 7 for all the trainingdata points.
-
重复步骤4 – 8,直到神经网络被正确训练。
-
Repeat Steps 4 - 8 until the neuralnetwork has been trained properly.
当然,多元分类神经网络也适用于二元分类。
Of course, the multiclass classificationneural network is applicable for binary classification.
我们所要做的是构造一个具有两输出节点的神经网络,并使用softmax函数作为激活函数。
All we have to do is construct a neuralnetwork with two output nodes and use the softmax function as the activationfunction.
示例:多元分类(Example: Multiclass Classification)
在本节中,我们实现从输入图像中识别数字的多元分类器网络。
In this section, we implement a multiclassclassifier network that recognizes digits from the input images.
二元分类已经在第3章中实现,其中输入数据的坐标被分成两组。
The binary classification has beenimplemented in Chapter 3, where the input coordinates were divided into twogroups.
它将数据分为0或1,因此是二元分类。
As it classified the data into either 0 or1, it was binary classification.
考虑识别图像中的数字。
Consider an image recognition of digits.
这是一种多元分类,因为它将图像分类为指定的数字。
This is a multiclass classification, as itclassifies the image into specified digits.
输入图像是5x5的像素方块,显示从1到5的五个数字,如图4-12所示。
The input images are five-by-five pixelsquares, which display five numbers from 1 to 5, as shown in Figure 4-12.
图4-12 5x5像素方块,显示从1到5的五个数字Five-by-five pixel squares that display five numbers from 1 to 5
神经网络模型包含一个单隐藏层,如图4-13所示。
The neural network model contains a singlehidden layer, as shown in Figure 4-13.
——本文译自Phil Kim所著的《Matlab Deep Learning》
更多精彩文章请关注微信号: