百年孤独 发表于 2013-7-20 11:58

新版Matlab中神经网络训练函数Newff的详细讲解


新版Matlab中神经网络训练函数Newff的详细讲解

一、   介绍新版newff
Syntax
·          net = newff(P,T,,{TF1 TF2...TFNl}, BTF,BLF,PF,IPF,OPF,DDF)
Description
newff(P,T,,{TF1 TF2...TFNl}, BTF,BLF,PF,IPF,OPF,DDF) takes several arguments

P
R x Q1 matrix of Q1 sample R-element input vectors
T
SN x Q2 matrix of Q2 sample SN-element target vectors
Si
Size of ith layer, for N-1 layers, default = [ ].
(Output layer size SN is determined from T.)
TFi
Transfer function of ith layer. (Default = 'tansig' for
hidden layers and 'purelin' for output layer.)
BTF
Backpropagation network training function (default = 'trainlm')
BLF
Backpropagation weight/bias learning function (default = 'learngdm')
IPF
Row cell array of input processing functions. (Default = {'fixunknowns','removeconstantrows','mapminmax'})
OPF
Row cell array of output processing functions. (Default = {'removeconstantrows','mapminmax'})
DDF
Data divison function (default = 'dividerand')

Examples
Here is a problem consisting of inputs P and targets T to be solved with a network.
·          P = ;T = ;
Here a network is created with one hidden layer of five neurons.
·          net = newff(P,T,5);
The network is simulated and its output plotted against the targets.
·          Y = sim(net,P);plot(P,T,P,Y,'o')
The network is trained for 50 epochs. Again the network's output is plotted.
·          net.trainParam.epochs = 50;net = train(net,P,T);Y = sim(net,P);
plot(P,T,P,Y,'o')

二、   新版newff与旧版newff调用语法对比
Example1
比如输入input(6*1000),输出output为(4*1000),那么
旧版定义:net=newff(minmax(input),,{'tansig','purelin'},'trainlm');
新版定义:net=newff(input,output,14,{'tansig','purelin'},'trainlm');
Example2
比如输入input(6*1000),输出output为(4*1000),那么
旧版定义:net=newff(minmax(input),,{'tansig','tansig','tansig'},'traingdx');
新版定义:net=newff(input,output, , {'tansig','tansig','tansig'},'traingdx');
更详细请看word文档

liziyan 发表于 2013-7-20 13:27

牛人啊!!!

西交峨眉 发表于 2017-4-25 22:05

谢谢,正好不知道怎么用
页: [1]
查看完整版本: 新版Matlab中神经网络训练函数Newff的详细讲解