フィルターのクリア

preparets error for using in narxnet

7 ビュー (過去 30 日間)
ZaidiN
ZaidiN 2018 年 7 月 12 日
編集済み: ZaidiN 2018 年 7 月 14 日
Following error is encountered with preparets: [x,xi,ai,t]=preparets(net,inputs,{},targets); .... Error using preparets (line 105) Feedback and inputs have different numbers of timesteps.
My Code reads Inputs from a xlsx file and targets with another xlsx file.
filepath='Inputdata.xlsx'; X=xlsread(filepath); % reading the Input file with size 8461*53
filepath='Targetdata.xlsx'; Y=xlsread(filepath); % Reading the Target Input file size 1*53
inputs=num2cell(X,1); targets=num2cell(Y,1);
trainFcn='trainlm'; inputDelays=1:2; feedbackDelays=1:2; hiddenLayerSize=5;
net=narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);
[x,xi,ai,t]=preparets(net,inputs,{},targets);
  1 件のコメント
ZaidiN
ZaidiN 2018 年 7 月 14 日
I have solved the problem using reshape and con2seq: That makes the input and target of same size!
u=X(200:500,:); y=T(200:500,:);
r1=length (u); c1=size(u,2); % Taking size of Input vector r2=length (y); c2=size(y,2); % Taking size of Target vector
u=reshape(u,c1,r1); %Making cell array of Input Matrix %u=num2cell(X,1); u=con2seq(u);
y=reshape(y,c2,r2); %Making cell array of Target matrix %y=num2cell(T,1); y=con2seq(y);

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

回答 (1 件)

Greg Heath
Greg Heath 2018 年 7 月 14 日
Come on ...
Error using preparets (line 105) Feedback and inputs have different numbers of timesteps
So why don't you EXPLICITLY calculate the sizes ???????????????????
inputsize = size(inputs)
targetsize = size(targets)
Thank you for EXPLICITLY accepting my answer!
Greg
  1 件のコメント
ZaidiN
ZaidiN 2018 年 7 月 14 日
編集済み: ZaidiN 2018 年 7 月 14 日
Is it right to convert input of size (8461*53) to sequential vectors for narxnet training

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by