Input and target values are same for Narnet training? Please explain anyone
2 次查看(过去 30 天)
显示 更早的评论
Please tell me. Input and target values are same for Narnet training? Or giving randomly input?
0 个评论
回答(1 个)
Hari
2025-2-18
Hi Gendariz,
I understand that you are asking about the input and target values used in training a "NARX" (Nonlinear Autoregressive Network with Exogenous Inputs) network, specifically whether the input and target values should be the same or different.
Understanding NARX Network:
A "NARX" network is used for time series prediction, where the inputs are past values of the output (target) and optionally past values of other external inputs. The target is the future value you want to predict.
Input and Target Relationship:
The input and target are not the same. The input consists of past values, while the target is the future value you wish to predict. For example, if you have a time series data, the input might be the past 10 values, and the target is the next value in the series.
Setting Up Inputs and Targets:
To set up a "NARX" network in MATLAB, you need to prepare your data with past and future values. Use the preparets function to align inputs and targets.
% Example time series data
data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
% Prepare inputs and targets
inputDelays = 1:2; % Past 2 values
feedbackDelays = 1:2; % Past 2 values of target
[inputs, targets] = preparets(narnet(inputDelays, feedbackDelays), {}, {}, con2seq(data));
Training the Network:
Use the prepared inputs and targets to train the "NARX" network using the train function.
net = narnet(inputDelays, feedbackDelays);
[net, tr] = train(net, inputs, targets);
Refer to the documentation of "narnet": https://www.mathworks.com/help/deeplearning/ref/narnet.html
Refer to the documentation of "preparets": https://www.mathworks.com/help/deeplearning/ref/preparets.html
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!