Output data size does not match net.outputs{3}.size.

2 ビュー (過去 30 日間)
Amanuel Kachiko Kuno
Amanuel Kachiko Kuno 2024 年 3 月 7 日
回答済み: Ayush Aniket 2024 年 6 月 18 日
I = out.Input;
T = out.Output;
net=newff(minmax(I),[3,5,3],{'logsig', 'tansig','purelin'},'trainlm');
But what i get the error is :
Error using network/train (line 340)
Output data size does not match net.outputs{3}.size
Error in ANN (line 15)
net=train(net,I,T);% Start trining the network
But my inputs are:
out= 1x1SimulationOutput with in that
Input = 4000001x3
Output = 400000x3
I tried a lot Please help me as much as possible. thanks in advance for your guidance.
  2 件のコメント
Alexander
Alexander 2024 年 3 月 7 日
Can you supply some code that throws this error?
Amanuel Kachiko Kuno
Amanuel Kachiko Kuno 2024 年 3 月 7 日
I = out.Input;
T = out.Output;
net=newff(minmax(I),[3,5,3],{'logsig', 'tansig','purelin'},'trainlm');
net.trainParam.show=1;
net.trainParam.epochs = 1000;
net.trainParam.goal =1e-12;
net=train(net,I,T);

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

回答 (1 件)

Ayush Aniket
Ayush Aniket 2024 年 6 月 18 日
Hi Amanuel,
The error you encounter is due to the incorrect syntax of the inputs and targets to the neural network. The network expects the inputs in the form of RxQ1 matrix of Q1 (number of samples) representative R-element input vectors (number of features) and outputs as SNxQ2 matrix of Q2 representative SN-element target vectors. The correct method would be to transpose your I and T matrices as shown below:
%Considering I and T to be in the shape (400000 x 3)
I = out.Input;
T = out.Output;
net=newff(minmax(I'),[3,5,3],{'logsig', 'tansig','purelin'},'trainlm');
net.trainParam.show=1;
net.trainParam.epochs = 1000;
net.trainParam.goal =1e-12;
net=train(net,I',T');
You can access the documentation for newff function by using the command below:
help newff
Note - The newff function has been obsolete since a long time. You should use feedforwardnetwork function instead, and can read more about it at the following documentation link:

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by