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

在这里插入图片描述
图4-2 二元分类的训练数据格式Training data binaryclassification

图中的前两个数字分别表示x和y坐标,符号表示该数据所属的类别。

The first two numbers indicate the x and ycoordinates respectively, and the symbol represents the group in which the databelongs.

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

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

现在,让我们构造神经网络。

Now, let’s construct the neural network.

输入节点的数目等于输入参数的数目。

The number of input nodes equals the numberof input parameters.

由于本示例的输入由x和y两个参数组成,因此网络采用两个输入节点。

As the input of this example consists oftwo parameters, the network employs two input nodes.

我们需要一个输出节点,因为要将输入数据分为两类。

We need one output node because thisimplements the classification of two groups as previously addressed.

采用sigmoid函数作为激活函数,隐藏层具有四个节点。

The sigmoid function is used as theactivation function, and the hidden layer has four nodes.

隐藏层不是我们关心的内容。

The hidden layer is not our concern.

根据分类数量变化的层是输出层,而不是隐藏层。

The layer that varies depending on thenumber of classes is the output layer, not the hidden layer.

隐藏层的组成没有标准规则,这里选择4个节点只是基于经验的规则。(但值得注意的是:隐藏层越复杂,神经网络的运算量越大,但是学习速度可能会越快,各项性能指标也会更好,因此在实际的设计中,一项优秀的设计应当是复杂度与性能之间的最佳折中;如同买一件衣服,最好的衣服可以无穷贵,但对于每个人来说,我们只需要买最合适的衣服,而不是最好的衣服)

There is no standard rule for thecomposition of the hidden layer.

图4-3示出了以上描述的神经网络。

Figure 4-3 shows the described neuralnetwork.

在这里插入图片描述
图4-3 训练数据的神经网络Neural network for thetraining data

当我们用给定的训练数据训练这个网络时,我们可以得到我们想要的二元分类。

When we train this network with the giventraining data, we can get the binary classification that we want.

然而,存在一个问题。

However, there is a problem.

神经网络产生范围从0 - 1的数值输出,而最终的数据分类结果只划分为两类,即△和●。

The neural network produces numericaloutputs that range from 0-1, while we have the symbolic correct outputs givenas △ and ●.

我们不能用这种方式计算误差,我们需要把符号转换成数字代码。

We cannot calculate the error in this way;we need to switch the symbols to numerical codes.

我们可以将sigmoid函数的最大值和最小值分配给如下两类符号:

We can assign the maximum and minimumvalues of the sigmoid function to the two classes as follows:
在这里插入图片描述

符号表示的变化产生如图4-4所示的训练数据。

The change of the class symbols yields thetraining data shown in Figure 4-4.

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

更多精彩文章请关注微信号:在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42825609/article/details/83443518