How to find rng No. of a trained network ?

1 view (last 30 days)
My humble hello to all users of this Forum.
After a long trial an error, I have found some very good results from a training network (while I was using 75% data for training). Since I didn't set the rng() number for that network. Is it possible to find that, Matlab is using what rng number for producing such a good results ??? For example is it rng(458); or rng(986), or rng (48) etc.???
As I mentioned, I have used 75% data for training. After setting the same rng number I will use the same network also for 70% data training, and then for 65% data training.
Thanks to all friends.

Answers (2)

Hiro Yoshino
Hiro Yoshino on 4 Feb 2020
You should have taken a note or fixed the seed number before the training.
As far as I know, there is no ways to find out what the number was.
However, how to randomize the weights is not generally an essential part in trainng.
So it was just lucky unless it converges to a good one using the same configuration for the network.

fred  ssemwogerere
fred ssemwogerere on 4 Feb 2020
Hello, it is always good practice to initiate the random number generator before training. This can be seeded with a number of your choosing such as:
rng(998,'twister'); % '998' is my arbitrary seed
% This way you can be able to reproduce your results on each startup
Otherwise, for now, i don't think Matlab has that option of reproducing the state of the rng.
  1 Comment
Muhammad Mohsin Khan
Muhammad Mohsin Khan on 4 Feb 2020
Hi Fred!,
Thanks for reply. Yes this is something not favourable I did, that I did not set up the rng number in start.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!