Prepare dataset for Neural State Space to be used as StateFcn in nlmpc
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Saskia Putri
il 23 Nov 2023
Commentato: Saskia Putri
il 4 Dic 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 Commenti
Risposta accettata
Arkadiy Turevskiy
il 27 Nov 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 Commenti
Arkadiy Turevskiy
il 30 Nov 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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Linear Plant Specification in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!