Problem with exact replication of maglev narx closed-loop output
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Greg Heath
el 9 de Mayo de 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 comentarios
Calvin
el 10 de Mayo de 2014
Greg Heath
el 12 de Mayo de 2014
Hope this helps.
Thank you for formally accepting my answer
Greg
Calvin
el 15 de Mayo de 2014
Greg Heath
el 19 de Mayo de 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
el 27 de Jun. de 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
el 3 de Jul. de 2014
Greg Heath
el 4 de Jul. de 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
Categorías
Más información sobre Parallel and Cloud en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!