Why the code is giving different results, every time I run it ???
17 ビュー (過去 30 日間)
古いコメントを表示
clc;clear all;close all;
net = newff([-10 10],[4 1],{'tansig','purelin'});
p = [-10 -5 0 5 10];
t = [0 0 1 1 1];
y = sim(net,p);
e = t-y;
perf = mse(e);
%%%%%%%%%%%%%%%%% End of the Code %%%%%%%%%%%%%%%%%%%%%%%
Why the result of the code is giving different results every time I run it.
1 件のコメント
Jan
2013 年 2 月 1 日
clc;clear all;close all; is a brute cleaning. Especially clear all is not useful, but use clear variables to allow Matlab to keep the expensively parsed functions in the memory.
採用された回答
Shashank Prasanna
2013 年 2 月 1 日
This is due to random setting of the initial weights and biases.
You can confirm that by setting the random seed each time and your results will be reproducible:
clc;clear all;close all;
rand('seed',0) % set random seed
net = newff([-10 10],[4 1],{'tansig','purelin'});
p = [-10 -5 0 5 10];
t = [0 0 1 1 1];
y = sim(net,p);
e = t-y;
perf = mse(e);
0 件のコメント
その他の回答 (1 件)
Vito
2013 年 2 月 1 日
Each time occurs network initialization. That is initial IW installation. Usually it occurs in a random way. Therefore result, on an untrained network always the different.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!