Problem with exact replication of maglev narx closed-loop output
Show older comments
I wrote a simple Matlab code to calculate a narx within the maglev example. The goal was to replicate the closed-loop output from the usual Matlab expression yc = netc(xc,xic,aic). My code is within the maglev example and uses the weights and bias' from the trained narx, so there shouldnt be any precision issues with reading weights from another file. The problem is my code does not perfectly replicate the closed-loop output. It is very close, and sometimes spot-on, but doesnt replicate perfectly every time.
Has anyone had this problem? I am not arrogant enough to seriously suspect a problem with Matlab, but I have to ask the question to see if anyone has had this issue. It is likely something silly with my code. I can trim it down to a reviewable size if anyone would like to help me out.
Thanks, Cal
Accepted Answer
More Answers (1)
Greg Heath
on 9 May 2014
Closed loop designs have the irritating property of propagating errors.
Typically, just closing an openloop design is not sufficient.
After using the closeloop fuction to convert from openloop, you should train the closeloop net starting with the weights obtained from the openloop design.
Search
greg closeloop
I probably have some examples in the NEWSGROUP and/or ANSWERS.
Hope this helps.
Thank you for formally accepting my answer
Greg
7 Comments
Calvin
on 10 May 2014
Greg Heath
on 12 May 2014
Hope this helps.
Thank you for formally accepting my answer
Greg
Calvin
on 15 May 2014
Greg Heath
on 19 May 2014
Impossible for me to respond when you refer to code which i have not seen. Since there are many ways to approach the problem, I would be wasting my time if i tried to guess exactly what you are trying to do and how you are trying to do it.
However, it shouuld be relatively easy for me to comment on posted code.
Greg Heath
on 27 Jun 2014
>>
net = narxnet(10);
inputprocessfcn = net.inputs{2}.processFcns
outputprocessfcn = net.outputs{2}.processFcns
inputprocessfcn =
'removeconstantrows' 'mapminmax'
outputprocessfcn =
'removeconstantrows' 'mapminmax'
Hope this helps.
Greg
Calvin
on 3 Jul 2014
Greg Heath
on 4 Jul 2014
It is a little confusing. Openloop narx has 2 inputs and 1 output
>> net.outputs
ans = [] [1x1 nnetOutput]
Therefore, the only output is net.outputs{2}
>> net.inputs
ans = [1x1 nnetInput]
[1x1 nnetInput]
Therefore, there are 2 inputs ( {1} and {2} ). However
>> net.inputs{1}
ans = ... name: 'x'
feedbackOutput: [] %input from exogeneous input, x
...
and
>> net.inputs{2}
ans = ... name: 'y'
feedbackOutput: 2 %input from 2 output feedback delays
Hope this helps.
Greg
Categories
Find more on Parallel and Cloud in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!