# How can I have the same initialization for all my networks?

I want to have the same weights for layer initializations in all my networks, so that when I'm comparing their first epoch loss they all start from the same value. Is there a way in keras to do this?

I have set the random seed for the numpy and tensorflow, but still I get different results in initializations.

• Have a look at this keras.io/initializers Aug 19, 2019 at 6:04
• @Ankit Seth yes i have set the seed for my initializer as well Aug 19, 2019 at 6:47
• hi - answered a similar question a little while back, it's a little trickier than you might think! datascience.stackexchange.com/a/37418/32697 Aug 19, 2019 at 10:43
• @redhqs hi,i followed your instructions but i couldn't get it to work Aug 20, 2019 at 13:08
• @redhqs no errors,the only problem is the cost function value of first epoch is different in each run Aug 24, 2019 at 5:27

from keras.initializers import RandomUniform