Why Neural Network Output is different every time???

2 views (last 30 days)
In Neural network tool Why it shows every time with different output???
eg:plotsomhits

Accepted Answer

Greg Heath
Greg Heath on 15 Apr 2015
Initial weights and data division are random unless you initialize the random number generator to the same state before training.
  3 Comments
Greg Heath
Greg Heath on 17 Jul 2020
I just use
close all, clear all, rng(0)
as the 1st line of my code.
Hope this helps
Greg
M J
M J on 17 Jul 2020
Edited: M J on 17 Jul 2020
Thanks a lot for the answer. The thing is that I intend to randomly shuffle my data as part of the training process, and compare validation accuracies associated with different training/validation combinations. Wouldn't that (writing it as the 1st line of the code) affect the random shuffling part too?
Best.

Sign in to comment.

More Answers (1)

SIDDHARAM GADDI
SIDDHARAM GADDI on 16 Apr 2015
just simply paste this code before traning the data..
rng('default');
You will get same result every time....

Community Treasure Hunt

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

Start Hunting!