I'm currently trying to fully understand what a Conv2D layer actually does and I think I got most of it. But theres one thing I don't quite get. When reading about Kernels there were multiple mentions that for example a (3,3) kernel, like this one

\begin{bmatrix} 0 & -1 & 0 \\\\ -1 & 5 & -1 \\\\ 0 & -1 & 0 \end{bmatrix}

is useful for e.g. sharpening an image.

But when I want to use a Conv2D layer in TensorFlow I don't have to specify this anywhere. Something like this is sufficient:

tf.keras.layers.Conv2D(4, 3, padding="same", activation="relu")

So what values are used for the kernel by default? Or am I missunderstanding this whole thing?


1 Answer 1


The values are learned during the training. Initially, they are given random values, then by means of back-propagation and gradient descent, the values of the kernels are adjusted during several iterations to make the final results as close as possible to the expected results.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.