What´s wrong with my neural network´s training?

Dear all,
I have this code for training neural network (type newff) and MATLAB is almost all day busy, but nothing happens (no training newff). Does anyone know, where is the mistake?
load ('trenovaci_modely2_stredni')
D = [stredni_tvar{1,:}];
F = [stredni_tvar{2,:}];
net_stredni_MLP = newff(D,F,20);
net.trainparam.epochs = 100;
net = train(net_stredni_MLP,D,F);
D = stredni_tvar{1,7};
J = sim(net_stredni_MLP,D);
save net_stredni_MLP
disp('Neuronová síť byla uložena')
Thank you for your answers.

 Akzeptierte Antwort

Greg Heath
Greg Heath am 19 Mär. 2015

0 Stimmen

net2 = train(net1,...);
Now there are 2 nets one trained and one untrained. Which do you think is untrained?
*Thank you for formally accepting this answer*
Greg

4 Kommentare

Veronika
Veronika am 19 Mär. 2015
I think, that net1 is untrained. But I really don´t know, I just think...
Yes. net1 is untrained. However, net1 is what you use in the rest of the program. Use
net1 = train(net1,...);
OK now?
I tried this:
load ('trenovaci_modely2_stredni')
D = [stredni_tvar{1,:}];
F = [stredni_tvar{2,:}];
net_stredni_MLP = newff(D,F,20);
net_stredni_MLP.trainparam.epochs = 100;
net_stredni_MLP = train(net_stredni_MLP,D,F);
D = stredni_tvar{1,7};
J = sim(net_stredni_MLP,D);
save net_stredni_MLP
disp('Neuronová síť byla uložena')
And still nothing, only "busy" as usual...
Today I tried another pictures (figures) for training neural network.
This is the code:
load ('trenovaci_modely4_nejmensi')
D = [nejmensi_tvar{1,:}];
F = [nejmensi_tvar{2,:}];
net_nejmensi_MLP = newff(D,F,20);
net_nejmensi_MLP.trainparam.epochs = 100;
net_nejmensi_MLP = train(net_nejmensi_MLP,D,F);
D = nejmensi_tvar{1,7};
J = sim(net_nejmensi_MLP,D);
save net_nejmensi_MLP
disp('Neuronová síť byla uložena')
And Command Window returns this:
Out of memory. Type HELP MEMORY for your options.
Error in removeconstantrows>reverse (line 262)
x = zeros(settings.xrows,q);
Error in nnproc.dperf (line 26)
AA{j+1} = processFcn.reverse(AA{j},processFcn.settings);
Error in C:\Program Files\MATLAB\R2011b\toolbox\nnet\nnutils\+nnprop\jac_s.p>jac_s (line 105)
Error in staticderiv>calc_jacobian (line 222)
jWB = nnprop.jac_s(net,data.P,data.Pd,data.Zb,data.Zi,data.Zl,...
Error in staticderiv (line 85)
out1 = calc_jacobian(in2,in3,in4);
Error in defaultderiv>calc_jacobian (line 217)
jWB = staticderiv('jacobian',net,data,fcns);
Error in nntraining.perfs_jejj>calc_Y_trainPerfJeJJ (line 87)
Jwb_y = fcns.deriv.calc_jacobian(net,signals,fcns);
Error in nntraining.perfs_jejj>singlecalc (line 58)
[Y,trainPerfy,trainN,JEy,JJy] = calc_Y_trainPerfJeJJ(net,data,fcns);
Error in nntraining.perfs_jejj (line 9)
[trainPerfy,trainN,valPerfy,~,testPerfy,~,JEy,JJy] = singlecalc(net,data,fcns);
Error in trainlm>train_network (line 199)
[perf,vperf,tperf,je,jj,gradient] = nntraining.perfs_jejj(net,data,fcns);
Error in trainlm (line 113)
[net,tr] = train_network(net,tr,data,fcns,param);
Error in network/train (line 106)
[net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
Error in nejmensi (line 110)
net_nejmensi_MLP = train(net_nejmensi_MLP,D,F;
Do you know, what does it mean? Thank you for answer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Greg Heath
Greg Heath am 18 Mär. 2015

0 Stimmen

I answered this in your previous post.

3 Kommentare

I know, but still nothing. Only "busy". I tried to do it with nntool function. I set input vector as D, target vector as F and created new network. But when I click on Train Network appeared warning saying:
Inputs and targets have different numbers of samples.
I don´t know what´s wrong...
Veronika
Veronika am 19 Mär. 2015
Here I attach variables D, F, J and trenovaci_modely2_stredni.
Greg Heath
Greg Heath am 19 Mär. 2015
I think you better go back and reread what I wrote.

Melden Sie sich an, um zu kommentieren.

Greg Heath
Greg Heath am 26 Mär. 2015

0 Stimmen

load('nntoolMLP.mat')
whos
% Name Size Bytes Class
%
% D 1x1 1776 cell
% F 1x1 616560 cell
% J 1x1 2160 cell
% stredni_tvar 2x301 1184736 cell
d = cell2mat(D);
f = cell2mat(F);
j = cell2mat(J);
s = cell2mat(stredni_tvar);
whos
Name Size Bytes Class
D 1x1 1776 cell
F 1x1 616560 cell
J 1x1 2160 cell
stredni_tvar 2x301 1184736 cell
d 208x1 1664 double
f 256x301 616448 double
j 256x1 2048 double
s 464x301 1117312 double
Your dimensions are not compatible.
Start by converting to doubles
Then fix the dimensions.

1 Kommentar

Ok, when I do this:
load ('trenovaci_modely2_stredni')
s = cell2mat(stredni_tvar);
D = [stredni_tvar{1,:}];
F = [stredni_tvar{2,:}];
d = cell2mat(D);
f = cell2mat(F);
j = cell2mat(J);
net_stredni_MLP = newff(D,F,20);
net_stredni_MLP.trainparam.epochs = 100;
net_stredni_MLP = train(net_stredni_MLP,D,F);
D = stredni_tvar{1,7};
J = sim(net_stredni_MLP,D);
save net_stredni_MLP
disp('Neuronová síť byla uložena')
Command Window returns this:
Cell contents reference from a non-cell array object.
Error in cell2mat (line 43)
cellclass = class(c{1});
Error in stredni (line 110)
d = cell2mat(D);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 18 Mär. 2015

Kommentiert:

am 27 Mär. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by