Problem getting adapt to work with my existing NARXNET: “Number of inputs does not match net.numInputs”
8 次查看(过去 30 天)
显示 更早的评论
I have a narxnet batch trained on historical data that I now want to implement in an “online situation” where I continuously feed new inputs and targets to it as they are generated and have the net adapt to the new data.
As far as I understand this is exactly what the adapt function is supposed to do but I’m not getting it to accept the new data I’m giving it. Before I use adapt I have a narxnet (called net) with 9 hidden nodes at 1:39 feedback delays and 1:39 input delays, and then I want to present the next input/targets by typing:
X=X2(1:1); %This is a cell containing 13x1 external inputs for one timestep
T=T2(1:1); % This is a cell containing 1x1 targets for the same timestep
[net,y,e,pf] = adapt(net,X,T); %Feed the existing net + inputs + targets to the adapt function.
But all I get when trying this is:
Error using network/adapt (line 92)
Number of inputs does not match net.numInputs.
If I type “net.numInputs” matlab returns the number 2. So I don’t understand what the problem here is, what does that even mean and why does it want 2 inputs? Isn’t the whole point of incremental training that I should be able to present the new data one at the time to the net?
I would really appreciate any advice on what I’m doing wrong here, I’ve searched for hours but the examples and documentation regarding how to implement adapt seems to be very limited...
Thanks.
0 个评论
采纳的回答
Greg Heath
2015-6-28
编辑:Greg Heath
2015-6-28
If you have a trained net (e.g., narxnet(ID,FD,H) ) with maxlag = max(ID,FD), you cannot get a result for a new sequence that is shorter than maxlag+1. PREPARETS should yield a dimension error.
An openloop narxnet has 2 inputs: One for the input and one for the target feedback.
Hope this helps.
Thank you for formally accepting my answer
Greg
更多回答(1 个)
Greg Heath
2015-6-22
You have to use preparets to determine the syntax of the input, target, input delay and feedback delay. Those are the inputs to train.
Greg
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!