Question about 'trainbr' in BPNN

1 view (last 30 days)
huan tu
huan tu on 12 Aug 2013
I use Bayesian regulation by implimenting 'trainbr' when calling newff function. Can anyone help me with the following two questions?
  1. The performance function should be changed to 'msereg', i.e. msereg = γmse + (1 − γ). But why the command window display: NET.performFcn has been set to SSE.
  2. The maximam epoch is set to 300, but the codes stoped at the epoch less than 300.
clc,clear
% samples
data=[ 550 50.9114 4.9195
550 53.9864 4.8926
550 56.3262 4.8658
550 58.5372 4.5436
550 59.9610 3.3356
500 42.2350 4.1678
500 47.3824 4.1141
500 49.3885 4.0604
500 52.0637 3.9597
500 54.0059 3.7248
500 54.6201 2.9664
475 38.7662 3.7584
475 43.1781 3.7248
475 45.1173 3.6711
475 47.5921 3.5638
475 50.0018 3.3557
475 50.6136 2.7383
450 34.8298 3.3423
450 37.0355 3.3356
450 40.7792 3.2886
450 43.9895 3.1678
450 45.7969 3.0000
450 46.3401 2.4899
400 28.0909 2.6376
400 31.3660 2.6376
400 33.3715 2.6107
400 35.9125 2.5436
400 37.9872 2.3826
400 38.5303 1.8792
350 19.5438 2.1477
350 24.2224 2.1544
350 27.0301 2.1208
350 29.2368 2.0604
350 31.1102 1.9463
350 31.7844 1.5973
300 14.3362 1.8054
300 19.3493 1.7852
300 21.4217 1.7651
300 23.4944 1.7181
300 25.2336 1.6376
300 26.5071 1.4228];
data=[data(:,1) data(:,3) data(:,2)];
p=data(:,[1 3])';
t=data(:,2)';
data1= [525.0000 46.3723
525.0000 50.6499
525.0000 52.6551
525.0000 53.6585
525.0000 54.0599
525.0000 55.1983
525.0000 56.7400
525.0000 57.6911];
dataInterp=data1';
n=10;
dataInterp_425 = [ 425*ones(1,n);linspace(31,42.3,n)];
data2= [250.0000 11.1324
250.0000 15.6110
250.0000 17.2824
250.0000 18.3522
250.0000 19.2214
250.0000 21.8308];
dataExtrap=data2';
[normInput,ps]=mapminmax(p);
[normTarget,ts]=mapminmax(t);
validatePercent=0.1;
testPercent=0.1;
[trainSamples,validateSamples,testSamples] = dividevec(normInput,normTarget,validatePercent,testPercent);
TF1 = 'tansig';
TF2 = 'tansig';
TF3 = 'purelin';
net=newff(normInput,normTarget,[10 10],{ },'trainbr');
net.trainParam.epochs=300;
net.trainParam.lr=0.1;
net.trainParam.goal=0.0001;
% net.divideFcn='';
% [net,tr] = train(net,trainSamples.P,trainSamples.T,[],[],validateSamples,testSamples);
[net,tr] = train(net,normInput,normTarget);
normInterp=mapminmax('apply',dataInterp,ps);
normExtrap=mapminmax('apply',dataExtrap,ps);
normInterp_425=mapminmax('apply',dataInterp_425,ps);
normTrainOutput=sim(net,normInput);
normInterpOutput=sim(net,normInterp);
normExtrapOutput=sim(net,normExtrap);
normInterp_425Output=sim(net,normInterp_425);
TrainOutput=mapminmax('reverse',normTrainOutput,ts);
InterpOutput=mapminmax('reverse',normInterpOutput,ts);
ExtrapOutput=mapminmax('reverse',normExtrapOutput,ts);
Interp_425Output=mapminmax('reverse',normInterp_425Output,ts);
figure(1)
% comparison of traning data and predictions
plot(p(2,:),TrainOutput,'o');
hold on
plot(p(2,:),t,'r*');
% interpolation
plot(dataInterp(2,:),InterpOutput,'o')
refInterp=[ 525 46.3723 4.5638
525 50.6499 4.5705
525 52.6551 4.5638
525 53.6585 4.5168
525 54.0599 4.4899
525 55.1983 4.3624
525 56.7400 4.1007
525 57.6911 3.1812 ];
refInterp=[refInterp(:,1) refInterp(:,3) refInterp(:,2)]';
plot(refInterp(3,:),refInterp(2,:),'rd','MarkerFaceColor','r')
% extrapolation
plot(dataExtrap(2,:),ExtrapOutput,'o')
hold on
refExtrap=[250.0000 1.5369 11.1324
250.0000 1.5101 15.6110
250.0000 1.4832 17.2824
250.0000 1.4631 18.3522
250.0000 1.4430 19.2214
250.0000 1.2819 21.8308]';
plot(refExtrap(3,:),refExtrap(2,:),'rd','MarkerFaceColor','r')
plot(dataInterp_425(2,:),Interp_425Output,'o')

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!