How retrain yet trained closed loop NAR

조회 수: 11 (최근 30일)
EanX
EanX 2015년 10월 1일
I want to retrain a yet trained closed loop NAR (to improve performance), but how?
Below my code.
% from open loop neto to closed
netc=closeloop(neto,Xoi,Aoi);
[Xc,Xci,Aci,Tc]=preparets(netc,{},{},T);
[Yc,Xcf,Acf]=netc(Xc,Xci,Aci);
Ec=gsubtract(Tc,Yc);
% some error metric
NMSEc=mse(Ec)/varto;
Ectrn=Ec(trnind);
Ecval=Ec(valind);
Ectst=Ec(tstind);
NMSEctrn=mse(Ectrn)/var(totrn,1);
NMSEcval=mse(Ecval)/var(toval,1);
NMSEctst=mse(Ectst)/var(totst,1);
R2ctrn = 1 - mse( Ectrn )/var(totrn,1);
R2cval = 1 - mse( Ecval )/var(toval,1);
R2ctst = 1 - mse( Ectst )/var(totst,1);
R2c = 1 - mse( Ec )/varto;
%%Retrain NAR
% [Xc, Xci, Aci,Tc ] = preparets(netc,{},{},T); % I think this is not necessary
% netc=configure(netc,Xc,Tc); % even this seems useless
% netc.trainFcn='trainlm'; % if I not change algorithm training stops after 3 or 4 iterations
% retrain using Xcf and Acf from netc output states?
[netcr,trcr, Ycr, Ecr, Acfr, Xcfr] = train(netc,Xc,Tc,Xcf,Acf);
NMSEcr=mse(Ecr)/varto;
R2cr = 1 - mse( Ecr )/varto;
Thanks!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by