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
5.8 , 30 , 6 , 8 , 0.2 , 14.59 , 0 ;
5.8 , 10 , 8 , 8 , 0.2 , 88.67 , 1 ;
5.2 , 12 , 6 , 7 , 0.15 , 1387.5 , 0
]';
T1 = [
0 ;
3 ;
26 ;
0 ;
0 ;
0 ;
96 ;
0 ;
5 ;
0 ;
542 ;
0 ;
0 ;
0 ;
292 ;
142 ;
154 ;
4 ;
14 ;
3 ;
152 ;
0 ;
1 ;
37 ;
9 ;
0 ;
0 ;
133 ;
5 ;
3 ;
594 ;
320
]';
[PN1,minp1,maxp1,TN1,mint1,maxt1] = premnmx(P1,T1);%go back to [-1 1]
net = newff(minmax(PN1),[7 5 1],{'tansig' 'logsig' 'purelin' },'trainscg','learngdm');
inputWeights=net.IW{1,1} ;
inputbias=net.b{1} ;
% the weights of the net
layerWeights=net.LW{2,1} ;
layerbias=net.b{2} ;
net.trainParam.epochs=2000;
net.trainParam.goal=0.000007;
net.trainParam.lr=0.1;
[net,tr]=train(net,PN1,TN1);
%p_x=linspace(1,32,7);
%p_week=linspace(0,60,50);
%p_y=[p_age;p_week];
p_test=[
6.4 , 29 , 9 , 9 , 0.4 , 4.5 , 0 ;
5.4 , 20 , 6 , 7 , 0.15 , 77.04 , 0 ;
5.3 , 10 , 6 , 7 , 0.1 , 556.77 , 0 ;
5.5 , 6.8 , 7 , 7 , 0.1 , 21.39 , 1 ;
5.3 , 27 , 6 , 7 , 0.15 , 11.63 , 0 ]';
p_x_1=premnmx(p_test);
out = sim(net,p_x_1);
%meshgrid(p_age,p_week);
%[P,T] = postmnmx(PN,minp,maxp,TN,mint,maxt);%the reverse of the premnmx
out_1 = postmnmx(out,mint1,maxt1);%the reverse of the premnmx
out_1
%plot(p_x,out_1,'-o')
%grid on;
%label('')
%t=[1,2];
%box off;
%grid off;
%plot(t,Out','b');
%plot(t,Out,'b',t,X,'r');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -