Categories
Misc

convolutional layer – trainable weights TensorFlow2

I am using TF2.5 & Python3.8 where a conv layer is defined as:

 Conv2D( filters = 64, kernel_size = (3, 3), activation='relu', kernel_initializer = tf.initializers.GlorotNormal(), strides = (1, 1), padding = 'same', ) 

Using a batch of 60 CIFAR-10 dataset as input:

 x.shape # TensorShape([60, 32, 32, 3]) 

Output volume of this layer preserves the spatial width and height (32, 32) and has 64 filters/kernel maps applied to the 60 images as batch-

 conv1(x).shape # TensorShape([60, 32, 32, 64]) 

I understand this output. But when I do:

 conv1.trainable_weights[0].shape # TensorShape([3, 3, 3, 64]) 

I don’t understand this?

Help

submitted by /u/grid_world
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *