Prepare dataset for Neural State Space to be used as StateFcn in nlmpc
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Saskia Putri
el 23 de Nov. de 2023
Comentada: Saskia Putri
el 4 de Dic. de 2023
Hello,
I am trying to use the neural networks using the Neural State Space Models in MATLAB to be used as a state function in nonlinear mpc toolbox. During the training and validation process I want to use normalize data of the dataset to yield a generalizable data. However, I am not sure how to denormalize the data once the training and validation have been conducted. Can anyone one help me with this?
Thank you in advance.
3 comentarios
Respuesta aceptada
Arkadiy Turevskiy
el 27 de Nov. de 2023
Thanks for posting the code.
To de-normalize the data you need to save mean and standard deviation data used for normalization.
[TdataN,C,S]=normalize(Tdata);
% now train neural state space, use it to predict normalized data PdataN
% using sim
% Now you can "de-normalize"
Pdata=PdataN.*S+C;
HTH
Arkadiy
5 comentarios
Arkadiy Turevskiy
el 30 de Nov. de 2023
Hi,
In your case it looks like the outputs (same as states) are the last 9 columns of TTdata, right?
So the bias and standard deviation info you need are in the last 9 columns of C and S in my code snippet in the answer.
Take those and use to denormalize your state derivatives/states/outputs as needed.
[TTdataN,C,S]=normalize(TTdata);
% your code to train neural state space model goes here
% you compute state derivatives dxdt1 as in your code above
% Now you can "de-normalize" state derivaties
% The code below assumes TTdata has 12 columns, the first 3 columns are
% inputs, and the last 9 are states/outputs
Cstate=C(4:length(C));
Sstate=S(4:length(S));
dxdt1_denormalized=dxdt1.*Sstate+Cstate;
Hth
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Plant Specification en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!