Reputation: 525
I can't really understand following code:
'W_conv1': tf.Variable(tf.random_normal([5, 5, 1, 32]))
This is my frst convolutional layer(tutoral from here). I understand CNN's ver good...but is this piece of code basicly creating 5x5 filter(or local receptive fields) and 32 is depth of convolution laer(so 32 different filters, with different weights)?
But how to interpret32
in 'W_conv2': tf.Variable(tf.random_normal([5, 5, 32, 64]))
?
Upvotes: 0
Views: 726
Reputation: 4918
'W_conv2': tf.Variable(tf.random_normal([5, 5, 32, 64]))?
Here 32 is the number of input_channels (num filters of previous layer)
in general weight shape is in the following form:
[filter_height, filter_width, input_channels, output_channels]
For the first layer 'W_conv1': tf.Variable(tf.random_normal([5, 5, 1, 32]))
input_channels is the number of channels of the inputs. (1 for gray images, 3 for RGB images)
Upvotes: 1