problem with closeloop narx

조회 수: 2 (최근 30일)
FRANCISCO
FRANCISCO 2013년 1월 30일
I am spanish and i can't writte well english but i will try explain my problem. I want to create a RED NARX for predict values of future. I imported two records (inputs) and (targets). I prepared data with command preparets and i create the narxnet with one delay and 16 hiddenlayers. After, i train narxnet and simulated the data i got the outputs. But this outputs are delayed and i want values in future for example one day. I must use closeloop for obtain data in future. My problem is how iterate twice with closeloop because i does not got targets in future. how as would be the code of this part (closeloop) for iterate two times.
Many thanks
  댓글 수: 2
Greg Heath
Greg Heath 2013년 1월 31일
I hope you mean one hidden layer with 16 hidden nodes.
Greg
FRANCISCO
FRANCISCO 2013년 1월 31일
Yes, my code is: xlsread p xlsread t
p1=p' t1=t'
inputSeries = tonndata(pn,true,false); targetSeries = tonndata(tn,true,false);
% Create a Nonlinear Autoregressive Network with External Input
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize);
% Prepare the Data for Training and Simulation [inputs,inputStates,layerStates,targets] = preparets(net,inputSeries,{},targetSeries);
% Train the Network [net,tr] = train(net,inputs,targets,inputStates,layerStates);
% Test the Network outputs = net(inputs,inputStates,layerStates); errors = gsubtract(targets,outputs);
okei ,I get up here
% Closed Loop Network netc = closeloop(net); [xc,xic,aic,tc] = preparets(netc,inputSeries,{},targetSeries); yc = netc(xc,xic,aic);
well, now, for re-iterate i must introduce (yc) in function preparets for simulate again close loop?? As would this comand?? [xc,xic,aic,tc] = preparets(netc,yc,{},{});?? because targets now i have not. This is my problem, i do not know the target in (t+1) and ,how can i predict the next value with closeloop?. Many thanks and sorry for my english

댓글을 달려면 로그인하십시오.

채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 1월 30일
This is what an open loop looks like during training:
Since it is NARX you will have one y(t) as the target and x(t) as the eXogenous input.
When you close the loop as follows:
you will ONLY need to provide the eXogenous inputs, y(t) will be predicted by the output.
Scroll down to see the code of how this is done:
If you don't have an eXogenous input x(t) then you need to be using NAR network.
  댓글 수: 1
FRANCISCO
FRANCISCO 2013년 1월 31일
Sorry for taking so long is that I lie a little mathworks page. Many thanks for your reply Benji Bowbow. i have one last question. I train the narxnet and simulated the network. After, i close loop and simulate the network again. For iterated the network two times i introduce this previous outputs in close loop and simulate again. I am going to explain with code.
%import data%
xlsread p xlsread t
p1=p' t1=t'
inputSeries = tonndata(pn,true,false); targetSeries = tonndata(tn,true,false);
% Create a Nonlinear Autoregressive Network with External Input
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize);
% Prepare the Data for Training and Simulation [inputs,inputStates,layerStates,targets] = preparets(net,inputSeries,{},targetSeries);
% Train the Network [net,tr] = train(net,inputs,targets,inputStates,layerStates);
% Test the Network outputs = net(inputs,inputStates,layerStates); errors = gsubtract(targets,outputs);
okei ,I get up here
% Closed Loop Network netc = closeloop(net); [xc,xic,aic,tc] = preparets(netc,inputSeries,{},targetSeries); yc = netc(xc,xic,aic);
well, now, for re-iterate i must introduce (yc) in function preparets for simulate again close loop?? As would this comand?? [xc,xic,aic,tc] = preparets(netc,yc,{},{});?? because targets now i have not

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Greg Heath
Greg Heath 2013년 3월 13일
You can iterate as long as you have exogeneous inputs. If your last exogeneous input value is at t = tf, your last predicted output is at t = tf + LDB where
LDB = max([ID,FD])
is the length of your delay buffer.
However, there is a limited amount of good predictions beyond the end of the training series caused by the accumulation of prediction errors. Therefore, it is imperative that you do not overtrain an overfit (Nw > Ntrneq) openloop net.
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 1
FRANCISCO
FRANCISCO 2013년 3월 13일
Good, I could give an example using code to view more clearly, for example get the ten values. taking as input the exogenous variables today (one day)?. I'm a little busy and I do not know how to make the prediction.
Thank you very much for your reply

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by