I am building a CNN model with tensorflow and I wanted to know if it is possible to set somehow a seed for weights initialization in order to be able to have everywhere the same seed so that I can compare between different architectures of my model. Found answers on stack overflow like this Tensorflow weight initialization but didn't really help me so your help will be appreciated. Thanks in advance!
You can set the kernel_initializer in all the layers as per your requirement. The term kernel_initializer is a fancy term for which statistical distribution or function is used for initialising the weights.
The initializer can take different values. You can set them all zeros, ones or a constant value. You can also choose RandomUniform or RandomNormal with the seed value.
If you are using tensorflow for layer, then you can find details about different initializers here - Tensorflow Initialzer
If you are using Keras for layer, then you can find details about different initializers here - Keras Initializer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With