Training Data for NARX

20 ビュー (過去 30 日間)
wissal
wissal 2022 年 11 月 2 日
コメント済み: wissal zaher 2024 年 12 月 12 日 9:06
Hello,
I'm working on a university assignement where I had to create a model predicitve controller from scratch and generate training data to train a NARX neural network.
I have completed the first part and my data consists of an Input matrix U [1x25] and the resulting state (output) X [2x26]
The number of rows is arbitrary and changes according the number of time steps I chose.
The output has one extra row because of the initial state X0
My question is how do I proceed to create a valid dataset to train a NARX network? How do I get from my controller results a compatible data structure ? How should it look like ?
I'm really clueless because I'm new to this and very much willing to learn more.
Any feedback is appreaciated.

回答 (1 件)

Tejas
Tejas 2024 年 12 月 9 日 7:22
Hello Wissal,
To create a training dataset for a NARX model, follow these steps:
  • Convert the input matrix 'U' and the output matrix 'X' into cell arrays. Make sure there is a one-to-one correspondence between the input data and the output data.
U_cell = num2cell(U, 1);
X_cell = num2cell(X(:, 1:end-1), 1);
  • Prepare the NARX network according to your requirements. Below is an example code snippet for guidance on this process.
inputDelays = 1:2;
feedbackDelays = 1:2;
net = narxnet(inputDelays, feedbackDelays, 10);
[Xs, Xi, Ai, Ts] = preparets(net, U_cell, {}, X_cell);
[net, tr] = train(net, Xs, Ts, Xi, Ai);
  1 件のコメント
wissal zaher
wissal zaher 2024 年 12 月 12 日 9:06
Thank you :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by