neuralnet function not working with more than one input

1 回表示 (過去 30 日間)
Lucas Ferreira-Correia
Lucas Ferreira-Correia 2019 年 7 月 4 日
回答済み: Sahithi Kanumarlapudi 2019 年 7 月 25 日
Hi
I've been trying to obtain a NARX model via neuralnet. The model has three inputs and one output.
z = iddata(T, [X1 X2 X3], 0.1);
ff_net = feedforwardnet(5);
ff_net.numInputs = 3;
ff_net.inputs{1}.name = 'Current';
ff_net.inputs{2}.name = 'Temperature';
ff_net.inputs{3}.name = 'SOC';
ff_net.inputConnect = [1 1 1; 0 0 0];
ff_net.divideFcn = 'divideblock';
ff_net.divideParam.trainRatio = 0.4;
ff_net.divideParam.valRatio = 0.3;
ff_net.divideParam.testRatio = 0.3;
nonlinearity = neuralnet(ff_net);
Every time I try to run the script it gives me the error:
Error using neuralnet/set.Network (line 122)
The value of the "numInputs" property of the NETWORK object must be equal to 1.
Error in neuralnet (line 99)
this.Network = net;
leading me to assume it won't work with multiple inputs but how else can I do what I want?
Hope you understand me, I myself am very new to this area.
Cheers,
Lucas
edit: Perhaps it has something to do with the fact that Matlab doesn't know that eg. Current is X1. Is there a way to make the connection?

採用された回答

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2019 年 7 月 25 日
neuralnet cannot be used to obtain NARX model in your case as you have multiple number of inputs.
narxnet can be used to obtain a NARX model.
Refer to narxnet documentation page here
Here is how you could obtain a NARX model

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by