Main Content

多层浅层神经网络架构

本主题介绍典型多层浅层网络工作流的一部分。有关详细信息和其他步骤,请参阅多层浅层神经网络与反向传播训练

神经元模型(logsig、tansig、purelin)

一个具有 R 个输入的基本神经元如下所示。每个输入都用适当的 w 进行加权。加权输入和偏置之和构成传递函数 f 的输入。神经元可以使用任何可微分的传递函数 f 来产生其输出。

Schematic diagram of a general neuron. The neuron multiplies a input vector p by a weights vector w, sums the result, and applies a bias b. A transfer function f is then applied, generating output a.

多层网络经常使用 log-sigmoid 传递函数 logsig

A plot of the log-sigmoid transfer function. For large positive inputs, the output tends to +1. For large negative inputs, the output tends to 0. An input of 0 gives an output of 0.5.

当神经元的净输入从负无穷大变为正无穷大时,函数 logsig 生成 0 到 1 之间的输出。

多层网络也可以使用 tan-sigmoid 传递函数 tansig

A plot of the tan-sigmoid transfer function. For large positive inputs, the output tends to +1. For large negative inputs, the output tends to -1. An input of 0 gives an output of 0.

Sigmoid 输出神经元经常用于模式识别问题,而线性输出神经元用于函数拟合问题。线性传递函数 purelin 如下所示。

A plot of the linear transfer function. The output scales linearly with the input.

此处所述的三个传递函数是多层网络中最常用的传递函数,但也可以根据需要创建和使用其他可微分的传递函数。

前馈神经网络

下图左侧详细显示了具有 R 个输入的由 S logsig 神经元组成的单层网络,右侧为层图。

Schematic diagram showing a layer containing S logsig neurons.

前馈网络通常有一个或多个由 sigmoid 神经元组成的隐藏层,后跟一个由线性神经元组成的输出层。具有非线性传递函数的由神经元组成的多个层允许网络学习输入和输出向量之间的非线性关系。线性输出层最常用于函数拟合(或非线性回归)问题。

另一方面,如果您要约束网络的输出(例如在 0 和 1 之间),则输出层应使用 sigmoid 传递函数(例如 logsig)。当网络用于模式识别问题时就是这种情况(在这种情况下,由网络作出决定)。

对于多层网络,层编号决定权重矩阵中的上标。下面显示的两层 tansig/purelin 网络中使用了适当的表示法。

A schematic diagram of a network containing two layers. A hidden layer receives an input vector p. The weights of the hidden layer are denoted with a superscript 1. An output layer receives the output of the hidden layer. The weights of the output layer are denoted with a superscript 1.

该网络可用作通用函数逼近器。只要隐藏层中有足够多的神经元,它就可以逼近任何具有任意有限数量的不连续点的函数。

现在已定义多层网络的架构,下面几节将介绍设计过程。