Replicating NARX architecture?

조회 수: 1 (최근 30일)
Ziheng Wang
Ziheng Wang 2017년 4월 1일
답변: Greg Heath 2017년 4월 2일
inputDelays = 1:delay;
hiddenLayerSize = 1;
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize);
[inputs,inputStates,layerStates,targets] = preparets(net,inputSeries,{},targetSeries);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 30/100;
[net,tr] = train(net,inputs,targets,inputStates,layerStates);
nets = removedelay(net);
a = nets.IW{1,1};
b = nets.IW{1,2};
c = nets.b{1};
d = nets.lw{2,1};
e = nets.b{2};
tansig(a * 1 + b * 11 + c) *d + e
inputSeries = tonndata(1,true,false);
targetSeries = tonndata(11,true,false);
[xs,xis,ais,ts] = preparets(nets,inputSeries,{},targetSeries);
ys = cell2mat( nets(xs,xis,ais))
Dear all, I am trying to replicate what the NARX network does. I am using the above code, and I am not getting correct results. In particular, ys is what you'd expect (12), but my replication using matrix multiplication is an order of magnitude wrong. What am I doing wrong? Thank you very much!

채택된 답변

Greg Heath
Greg Heath 2017년 4월 2일
1. Please refrain from using numbers (e.g., 1, 11 and 12)
as variables
2. Show some results using the MATLAB narxnet data
obtained from the commands
a. help narxnet and/or doc narxnet
b. help nndatasets and/or doc nndatasets
3. Post enough information so that your work can be
duplicated, e.g.,
a. values of both delays
b. initial state of the random number generator
4. See some of my examples in the NEWSGROUP and ANSWERS by searching with
greg narxnet tutorial
and
greg narxnet
Hope this helps.
Thank you for formally accepting my answer
Greg

추가 답변 (0개)

카테고리

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