# 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:

1. 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?

2. 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.

• @stephen Thank you for the edit. The question does look a lot better then what it used to. – user43771 Dec 27 '17 at 0:49

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.