Окончание приложения В
(справочное)
Скрипт нейронной сети
%
Closed Loop Network
% Use this network to do multi-step prediction.
% The function CLOSELOOP replaces the
feedback input with a direct
% connection from the output layer.
netc = closeloop(net);
netc.name = [net.name
' - Closed Loop'
];
view(netc)
[xc,xic,aic,tc] = preparets(netc,{},{},T);
yc = netc(xc,xic,aic);
closedLoopPerformance = perform(net,tc,yc)
[x1,xio,aio,t] = preparets(net,{},{},T);
[y1,xfo,afo] = net(x1,xio,aio);
[netc,xic,aic] = closeloop(net,xfo,afo);
[y2,xfc,afc] = netc(cell(0,5),xic,aic);
nets = removedelay(net);
nets.name = [net.name
' - Predict One Step Ahead'
];
view(nets)
[xs,xis,ais,ts] = preparets(nets,{},{},T);
ys = nets(xs,xis,ais);
stepAheadPerformance = perform(nets,ts,ys)
if
(false)
genFunction(net,
'myNeuralNetworkFunction'
);
y = myNeuralNetworkFunction(x,xi,ai);
end
if
(false)
genFunction(net,
'myNeuralNetworkFunction'
,
'MatrixOnly'
,
'yes'
);
x1 = cell2mat(x(1,:));
xi1 = cell2mat(xi(1,:));
y = myNeuralNetworkFunction(x1,xi1);
end
if
(false)
gensim(net);
end