The effect of rng() on neural network training result
6 ビュー (過去 30 日間)
古いコメントを表示
I use rng('default') to control random number generation, so each neural network has the same divide data (train, validation, test) and initial weight/bias, then I change node size and compare the error to decide the best node size. But when I change rng('default') to rng(3,'twister'), I find the best node size is different from the previous one. Two rng() function gives the different answers, which one should I choose?
rng function (eg. rng('default'), rng(0,'twister'), rng('sshuffle')...) does not produce unique result for neural network training!
1 件のコメント
Greg Heath
2015 年 8 月 7 日
I am not familiar with the different types. I just stick with the old ones: rng(0), rng(4151941) and rng('default'). It's hard to believe that one way of generating pseudo random numbers will consistently result in better designs.
回答 (1 件)
Steven Lord
2015 年 8 月 7 日
The pseudorandom number generators will eventually (after generating a LARGE number of values) repeat themselves. The 'twister' generator, the Mersenne Twister, has an approximate period of 2^19937-1. When you use RNG with a seed value, you're basically specifying where in the period to start generating numbers. [Before you ask, it's not as simple as "the second number generated after starting at seed value 1 is the first number generated after starting at seed value 2."]
So you're starting at different points in the period when you use rng('default') and rng(3, 'twister'). There's nothing inherently "better" about either one; they're just different. As an example, if I want to get to New York City, New York, USA, then a seed value that started me in Boston, Massachusetts, USA would be better than one that started me in Paris, France. But if I wanted to get to Berlin, Germany, the Paris starting point may be better.
1 件のコメント
Greg Heath
2015 年 8 月 8 日
This is not an answer to your question. However, it is an interesting point to ponder.
Most of the NN functions have a default of 10 hidden nodes. For a trained SISO 1-10-1 MLP, how many ways can the weighted nodes be reordered without changing the output?
参考
カテゴリ
Help Center および File Exchange で Random Number Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!