How to find the value used to seed neural networks in Matlab?

4 views (last 30 days)
Hi,
I am using this in Matlab to build and train a neural network, network = fitnet(15); [network, model] = train(network, trainData, trainLabels);
The training results are different each time I run the code. I know that this is due to the random generation of initial weights and biases seeded by some value.
Is it possible for me to know this seed value? If yes, then how can I get it?

Accepted Answer

Steven Lord
Steven Lord on 26 May 2017
Store the state of the random number generator using rng BEFORE you create or initialize your network. Then you can restore the state (again using rng) before the next time you create or initialize a network.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!