Problem getting adapt to work with my existing NARXNET: “Number of inputs does not match net.numInputs”
8 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Greg Heath
on 28 Jun 2015
Edited: Greg Heath
on 28 Jun 2015
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
More Answers (1)
Greg Heath
on 22 Jun 2015
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
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!