Questions about CNN: weights and biases I have a question regarding CNN.
I do understand how they work on the surface. Very simply put, they are D-NN for images.
I'll use this example as a reference for this question. In the example, they are not initializing weights and biases anywhere. They are using tf.layers.conv2d() function in the example.
Let's focus only on 2 of the function's arguments:

filters: specify the number of filters to apply
kernel_size: specifies the size of each filter

Questions:

We are not defining these filters. Does tensorflow define them for us or in general if I were to use this for a different set of images how does this work?

Does this filter include both weights and biases? If not, then what exactly does the GradientDescentOptimizer() defined in the above example update after each training step?


I understood the code and understand how the entire process works. I also understand convolution and how it works. But, I'm trying to apply these concepts and implement my own code using tensorflow and CNN and I'm kind of stuck here.
If you do not specify them, as it is clear in the signature of the functions you are referring to, the function will use the default value for them. For instance, you can see that the default value for stride is (2, 2) which means if you don't define the value of stride the method will use the mentioned value as the default value for the stride. Consequently, if you don't specify it, it does not mean there isn't such thing. In programming this approach helps programmers not to define many different overloads of a typical function.

As the response for the second question, again, if you don't specify the initial weights, TensorFlow itself will use Glorot method for initialization. So, definitely the filters will have values called weights in order to operations like convolution, actually cross correlation, be applicable.

As a recommendation, I highly suggest you taking a look at here and here.