Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Amanuel Kachiko Kuno
Amanuel Kachiko Kuno le 7 Mar 2024
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 commentaires
Alexander
Alexander le 7 Mar 2024
Can you supply some code that throws this error?
Amanuel Kachiko Kuno
Amanuel Kachiko Kuno le 7 Mar 2024
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);

Connectez-vous pour commenter.

Réponses (1)

Ayush Aniket
Ayush Aniket le 18 Juin 2024
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:

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Tags

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by