使用MATLAB实现BP神经网络的newff函数参数设置

147 篇文章 35 订阅 ¥59.90 ¥99.00
本文详细介绍了如何在MATLAB中使用newff函数创建和训练BP神经网络,包括参数设置如输入数据矩阵、目标矩阵、隐含层神经元数量、转移函数、性能函数等,并给出了完整代码示例。
摘要由CSDN通过智能技术生成

BP神经网络是一种常用的人工神经网络模型,用于解决分类和回归问题。在MATLAB中,可以使用newff函数来创建并训练BP神经网络。本文将详细介绍如何使用MATLAB实现BP神经网络,并给出相应的源代码。

首先,我们需要了解newff函数的参数设置。newff函数的语法如下:

net = newff(P,T,S,TF,BTF,BLF,PF,IPF,OPF,DDF)

其中,各个参数的含义如下:

  • P: 输入数据的样本矩阵,每列代表一个输入样本。
  • T: 目标矩阵,每列代表一个目标样本。
  • S: 各个隐含层的神经元数量的向量。
  • TF: 输出层的转移函数。
  • BTF: 隐含层的转移函数。
  • BLF: 输出层的转移函数。
  • PF: 性能函数。
  • IPF: 输入处理函数。
  • OPF: 输出处理函数。
  • DDF: 分配函数。

接下来,我们将逐个参数介绍,并给出相应的代码示例。

  1. 输入数据矩阵 §

输入数据矩阵P是一个m×n的矩阵,其中m表示输入样本的数量,n表示输入样本的维度。每列代表一个输入样本。下面是一个示例:

P = 
新版Matlab神经网络训练函数Newff的详细讲解-新版Matlab神经网络训练函数Newff使用方法.doc 本帖最后由 小小2008鸟 于 2013-1-15 21:42 编辑 新版Matlab神经网络训练函数Newff的详细讲解 一、   介绍新版newffSyntax·          net = newff],{TF1 TF2...TFNl}, BTF,BLF,PF,IPF,OPF,DDF) Descriptionnewff],{TF1 TF2...TFNl}, BTF,BLF,PF,IPF,OPF,DDF) takes several arguments PR x Q1 matrix of Q1 sample R-element input vectorsTSN x Q2 matrix of Q2 sample SN-element target vectorsSiSize of ith layer, for N-1 layers, default = [ ]. TFiTransfer function of ith layer. (Default = 'tansig' for hidden layers and 'purelin' for output layer.)BTFBackpropagation network training function BLFBackpropagation weight/bias learning function IPFRow cell array of input processing functions. OPFRow cell array of output processing functions. DDFData divison function ExamplesHere is a problem consisting of inputs P and targets T to be solved with a network.·          P = [0 1 2 3 4 5 6 7 8 9 10];T = [0 1 2 3 4 3 2 1 2 3 4];Here a network is created with one hidden layer of five neurons.·          net = newff;The network is simulated and its output plotted against the targets.·          Y = sim;plotThe network is trained for 50 epochs. Again the network's output is plotted.·          net.trainParam.epochs = 50;net = train;Y = sim; plot 二、   新版newff与旧版newff调用语法对比 Example1比如输入input(6*1000),输出output为(4*1000),那么旧版定义:net=newff,[14,4],{'tansig','purelin'},'trainlm');新版定义:net=newff; Example2比如输入input(6*1000),输出output为(4*1000),那么旧版定义:net=newff,[49,10,4],{'tansig','tansig','tansig'},'traingdx');新版定义:net=newff; 更详细请看word文档 新版Matlab神经网络训练函数Newff使用方法.doc
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值