Hi All, I am a newbie so please bear with me.
I have a input file containing (17x127) data (Force) and a target file of (3x127)(True Stress).
I have written the following code for training the neural networks:
p=Force; t=T_Stress;
net =newff(minmax(p),[10,1],{'tansig','purelin'},'trainlm');
net.trainParam.lr = .05; %Learning Rate net.trainParam.epochs = 300; %Max Ephocs net.trainParam.goal = 1e-5; %Training Goal in Mean Sqared Error net.trainParam.show = 50; %# of ephocs in display
[net,tr1] = train(net,p,t); o1 = sim(net,p)
However I get the following errors:
??? Error using ==> trainlm at 109 Output data size does not match net.outputs{2}.size.
Error in ==> network.train at 107 [net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
Any helps with the above errors are very much appreciate it.

3 commentaires

Muhammad Qamar RAZA
Muhammad Qamar RAZA le 30 Août 2012
i think trainlm function does't the too much inputs. So may be you can tranb,traigcd,trainsch or other training functions.
Greg Heath
Greg Heath le 4 Sep 2012
NO!
You have defined a net with 1 output.
However, your target data has 3 outputs.
Fix your net = newff command.
Greg
Get,
I think the question is related to a Matlab example at simplecluster_dataset command.
when running:
[x,t] = simplecluster_dataset;
plot(x(1,:),x(2,:),'+')
net = selforgmap([8 8]);
net = train(net,x,t);
The following error is returned:
Error using network/train (line 340) Output data size does not match net.outputs{1}.size.

Connectez-vous pour commenter.

 Réponse acceptée

Greg Heath
Greg Heath le 27 Avr 2012

0 votes

[I N ] = size(p)
[ O N ] = size(t)
H = 10
net =newff(minmax(p),[H,O]);
[net,tr1] = train(net,p,t);
o1 = sim(net,p)
Hope this helps
Greg

Plus de réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by