user121
user121

Reputation: 931

Where is the kernel weight initialization in my CNN model?

I am using a convolutional neural net (CNN) called make_unet from here. It works and code is able to run with this CNN. But I know that in deep learning you have to initialize weights for optimization of the neural network.

The documentation in Keras clearly indicates the use of a kernel_initializer for weight initialization. However, I do not see any kernel_initializer in the make_unet function I am using.

Anyone who can provide some insight would be appreciated.

Upvotes: 4

Views: 2985

Answers (1)

Eli Korvigo
Eli Korvigo

Reputation: 10513

In Keras initialisers are passed on a per-layer basis via arguments kernel_initializer and bias_initializer, e.g.

Dense(64, kernel_initializer='random_uniform', bias_initializer='zeros')

All built-in layers come with a sensible default initialiser. For example, all convolutional layers use kernel_initializer='glorot_uniform', bias_initializer='zeros'. Keras gives you many alternative options. You can also create your custom initialisers.

Upvotes: 6

Related Questions