Why not train neural network newff?

2 ビュー (過去 30 日間)
Veronika
Veronika 2015 年 3 月 14 日
コメント済み: Veronika 2015 年 3 月 16 日
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.

採用された回答

Greg Heath
Greg Heath 2015 年 3 月 15 日
編集済み: Greg Heath 2015 年 3 月 15 日
load ('trenovaci_modely2_stredni')
D = [stredni_tvar{1,:}];
F = [stredni_tvar{2,:}];
[ I N ] = size(D) % = ?
[ O N ] = size(F) % = ?
net_stredni_MLP = newff(D,F,20);
net.trainparam.epochs = 100;
net = train(net_stredni_MLP,D,F);
% The trained model is net, NOT net_stredni_MLP!
% D = stredni_tvar{1,7}; DELETE
D7 = D(1,7) % WHY JUST ONE POINT??
% J = sim(net_stredni_MLP,D); DELETE
% save net_stredni_MLP DELETE
J7 = sim( net, D7); % Only 1 point
J = sim( net, D ); % N points
save net
disp('Neuronová síť byla uložena')
Hope this helps.
Thank you for formally accepting my answer
Greg
  3 件のコメント
Greg Heath
Greg Heath 2015 年 3 月 16 日
Your workspace dimensions do not make sense. If you have one O-dimensional target vector for each I-dimensional input vector, then at least one of the dimensions of the input matrix and target matrix has to be the same. Then, transposing if you have to
[ I N ] = size(input)
[ O N ] = size(target)
What is
size(stredni_tvar)?
Veronika
Veronika 2015 年 3 月 16 日
I know, but I don´t know what´s wrong. Because when I used different images in EIDORS (doesn´t matter) in workspace:
input D <208x301 double> and target F <64x301 double>.
Command Window returns:
[I N] = size(D)
I =
208
N =
301
[O N] = size(F)
O =
64
N =
301
So the neural network trains good. I think, that I did it exactly the same way. So I don´t know, where is mistake. Regarding size of stredni_tvar:
size (stredni_tvar)
ans =
2 301

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by