フィルターのクリア

I cannot get closed loop network to run.

1 回表示 (過去 30 日間)
Kevin Johnson
Kevin Johnson 2021 年 11 月 29 日
コメント済み: Kevin Johnson 2021 年 11 月 29 日
%first, I prepare the open network in the usual way
net=narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);
% Prepare Data
X = tonndata(inputs,false,false);
T = tonndata(target,false,false);
[x,xi,ai,t] = preparets(net,X,{},T);
% Train on first half of data
% r is the length of the data
% 2 represents the delays
hw=floor(r/2);
x_firsthalf=x(:,1:hw-2);
t_firsthalf=t(1:hw-2);
net = train(net,x_firsthalf,t_firsthalf,xi,ai);
% Get the (in-sample) open loop results on the first half of the data
[yopen,xf,af] = net(x_firsthalf,xi,ai);
% These results are good, as expected.
% Convert to closed loop network
[netc,xi,ai]=closeloop(net,xf,af);
% Get the closed loop results on the second half of the data
x_secondhalf=x(:,hw-2+1:end);
[yclosed,xf,af] = netc(x_secondhalf,xi,ai);
% Returns error message: "Error using network/sim (line 270)
% Number of inputs does not match net.numInputs."
% Yet x_firsthalf and x_secondhalf have the same numbers of input columns.
% What am I overlooking?
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 11 月 29 日
But what is size(xf) and size(xi) ?
Hypothethically, the closeloop() might have changed the number of inputs required.
Kevin Johnson
Kevin Johnson 2021 年 11 月 29 日
In [netc,xi,ai]=closeloop(net,xf,af), size of xf is 2x2, and size of xi is 1 x 2. The target column was dropped by closeloop. When I remove it before using netc, netc executes (though the closed loop results are very poor unfortunately!). Thanks for your help.

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by