上一章:
下一章:
---------------------------------------------------------------------------
神经网络工具箱的结构
工具箱是基于网络对象的。对象包含神经网络的所有信息。在matlab命令提示符下输入network,将建立一个空的网络,同时显示出它的参数。
>> network
ans =
Neural Network object:
architecture:
numInputs: 0
numLayers: 0
biasConnect: []
inputConnect: []
layerConnect: []
outputConnect: []
targetConnect: []
numOutputs: 0 (read-only)
numTargets: 0 (read-only)
numInputDelays: 0 (read-only)
numLayerDelays: 0 (read-only)
第一个显示的是结构参数。 因为 network 命令建立了一个空的网络,所有的参数都被设为0。子对象结构如下:
subobject structures: inputs: {0x1 cell} of inputs layers: {0x1 cell} of layers outputs: {1x0 cell} containing no outputs targets: {1x0 cell} containing no targets biases: {0x1 cell} containing no biases inputWeights: {0x0 cell} containing no input weights layerWeights: {0x0 cell} containing no layer weights
子对象结构包含各个输入、输出矩阵,偏置矩阵和输入权值。
functions:
adaptFcn: (none)
initFcn: (none)
performFcn: (none)
trainFcn: (none)
下一段十分有意思,包含了训练,初始化和执行函数。trainFcn 和 adaptFcn 本质上讲是一样的,但这个指南中将使用trainFcn. 通过设置trainFcn 的参数来告诉matlab训练使用的算法。神经网络工具箱包含近20种训练算法。执行函数决定神经网络是怎样工作的。initFcn 初始化网络的权值和偏置权值。输入 help nnet.得到这些函数的列表。将这些函数改变到工具箱中的其他函数或者你建立的函数,只要分配函数名就可以了,例如:
net.trainFcn = 'mytrainingfun';
与这些函数相关的参数列在下一节。
adaptParam: (none)
initParam: (none)
performParam: (none)
trainParam: (none)
通过改变参数,你可以改变函数的默认行为。你将用的最多的参数可能就是trainParam的成员。用的最多的是net.trainParam.epochs ,指定算法的最大训练次数, net.trainParam.show指定算法每个执行表达的训练次数。输入 help train 得到更多信息。权值和偏置权值也存储在网络结构中:
weight and bias values:
IW: {0x0 cell} containing no input weight matrices
LW: {0x0 cell} containing no layer weight matrices
b: {0x1 cell} containing no bias vectors
other:
userdata: (user stuff)
.IW是一个小数组,存储了输入层和第一隐含层的权值。
.LW存储了隐含层和输出层之间的权值。
---------------------------------------------------------------------------------------
上一章:
下一章: