?? trainnet.m
字號:
function [net,epochs,rms] = trainnet(in,targets,S1,validation)% WBL 22 August 2002 Use P450 training data to train Matlab MLP Nural Network% $Revision: 1.5 $ $Date: 2002/10/31 11:22:31 $%WBL 13 Sep 2002 as trainnet - but pass net via arguments, rather than saving to file%WBL 9 Sep 2002 implement early stopping%WBL 9 Sep 2002 Based on read.m % DEFINING THE NETWORK% ====================% S1 = number of nodes in hidden layer% S2 = number of output nodes (ie 2)S2 = 2;net = newff(minmax(in),[S1 S2],{'logsig' 'logsig'},'traingdx');%net.LW{2,1} = net.LW{2,1}*0.01;%net.b{2} = net.b{2}*0.01;% TRAINING THE NETWORK WITHOUT NOISE% ==================================net.performFcn = 'sse'; % Sum-Squared Error performance function%net.trainParam.goal = 0.1; % Sum-squared error goal.net.trainParam.show = inf; % Frequency of progress displays (in epochs).net.trainParam.epochs = 5000; % Maximum number of epochs to train.%net.trainParam.epochs = 5; % Maximum number of epochs to train.%net.trainParam.mc = 0.95; % Momentum constant.% Training begins...please wait...%[net,tr] = train(net,in,targets);[net,tr] = train(net,in,targets,[],[],validation);%trepochs = tr.epoch(size(tr.epoch,2));rms = sqrt(tr.perf(size(tr.perf,2))/size(in,2));%filename = sprintf('13-sep-2002_%dx%d', S1, ntests);%save (filename, 'net');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -