【读书1】【2017】MATLAB与深度学习——多元分类(1)

多元分类(Multiclass Classification)

本节介绍如何利用神经网络来处理三种或三种以上的分类。

This section introduces how to utilize theneural network to deal with the classification of three or more classes.

考虑将给定输入数据的坐标(x,y)划分为三类(参见图4-5)。

Consider a classification of the giveninputs of coordinates (x, y) into one of three classes (see Figure 4-5).


图4-5 将数据划分为三类Data with three classes

我们首先需要构造神经网络。

We need to construct the neural networkfirst.

我们将使用两个节点作为输入层,因为输入由两个参数组成。

We will use two nodes for the input layeras the input consists of two parameters.

为了简单起见,这里不考虑隐藏层。

For simplicity, the hidden layers are notconsidered at this time.

我们还需要确定输出节点的数目。

We need to determine the number of theoutput nodes as well.

众所周知,输出节点数与类别数相匹配是最有前途的方法。

It is widely known that matching the numberof output nodes to the number of classes is the most promising method.

在这个例子中,我们使用三个输出节点,因为这个问题需要将输入数据分为三类。

In this example, we use three output nodes,as the problem requires three classes.


图4-6示出了配置的神经网络。

Figure 4-6 illustrates the configuredneural network.

图4-6 将输入数据划分为三类的神经网络配置图Configured neuralnetwork for the three classes

一旦采用给定的数据训练神经网络,我们就获得了期望的多元分类器。

Once the neural network has been trainedwith the given data, we obtain the multiclass classifier that we want.

训练数据在图4-7中给出。

图4-7 采用多元分类器训练数据Training data withmulticlass classifier

对于图中的每个数据点,前两个数字分别是x和y坐标,第三个值是对应的类别。

For each data point, the first two numbersare the x and y coordinates respectively, and the third value is thecorresponding class.

训练数据包括输入和正确输出,因为该数据被用于监督学习。

The data includes the input and correctoutput as it is used for supervised learning.

为了计算误差,我们将类别名转换成数字代码,如同前一节中所做的那样。

In order to calculate the error, we switchthe class names into numeric codes, as we did in the previous section.

考虑到我们的神经网络具有三个输出节点,我们将类别与向量的对应关系映射如下:

Considering that we have three output nodesfrom the neural network, we create the classes as the following vectors:

——本文译自Phil Kim所著的《Matlab Deep Learning》

更多精彩文章请关注微信号:

你可能感兴趣的:(【读书1】【2017】MATLAB与深度学习——多元分类(1))