神经网络工具箱的结构

该篇博客介绍了MATLAB神经网络工具箱的结构,强调工具箱基于网络对象,详细阐述了空网络的参数设置,如输入、输出、偏置等,并提到了训练、初始化和执行函数的作用。此外,还提及了如何自定义训练算法和调整训练参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

翻译:xychn15@yahoo.com.cn

上一章:

下一章:

目录

---------------------------------------------------------------------------

神经网络工具箱的结构

工具箱是基于网络对象的。对象包含神经网络的所有信息。在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)

下一段十分有意思,包含了训练,初始化和执行函数。trainFcnadaptFcn 本质上讲是一样的,但这个指南中将使用trainFcn. 通过设置trainFcn 的参数来告诉matlab训练使用的算法。神经网络工具箱包含近20种训练算法。执行函数决定神经网络是怎样工作的。initFcn 初始化网络的权值和偏置权值。输入 help nnet.得到这些函数的列表。将这些函数改变到工具箱中的其他函数或者你建立的函数,只要分配函数名就可以了,例如:

net.trainFcn = 'mytrainingfun';
与这些函数相关的参数列在下一节。

    parameters:

        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存储了隐含层和输出层之间的权值。

---------------------------------------------------------------------------------------

上一章:

下一章:

目录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值