Search code examples
pythonmachine-learningkerasneural-network

Where to find a documentation about default weight initializer in Keras?


I just read about the Keras weight initializers in here. In the documentation, only different initializers has been introduced. Such as:

model.add(Dense(64, kernel_initializer='random_normal'))

I want to know what is the default weight when I don't specify the kernel_initializer argument. Is there a way to access it?


Solution

  • Each layer has its own default value for initializing the weights. For most of the layers, such as Dense, convolution and RNN layers, the default kernel initializer is 'glorot_uniform' and the default bias intializer is 'zeros' (you can find this by going to the related section for each layer in the documentation; for example here is the Dense layer doc). You can find the definition of glorot_uniform initializer here in the Keras documentation.

    As for accessing the weights of each layer, it has already been answered here.