Complete the code to create a 2D convolutional layer with 32 filters and a kernel size of 3.
conv_layer = tf.keras.layers.Conv2D(filters=[1], kernel_size=3, activation='relu')
The number of filters defines how many feature detectors the convolutional layer will learn. Here, 32 filters are specified.
Complete the code to apply a convolution operation on input tensor x using the conv_layer.
output = conv_layer([1])The convolutional layer is applied to the input tensor x to produce the output feature maps.
Fix the error in the code to correctly define a Conv2D layer with a 5x5 kernel size.
conv = tf.keras.layers.Conv2D(filters=64, kernel_size=[1], activation='relu')
The kernel_size parameter expects a tuple for height and width, so (5, 5) is correct.
Fill both blanks to create a convolutional layer with 16 filters and a stride of 2.
conv_layer = tf.keras.layers.Conv2D(filters=[1], kernel_size=3, strides=[2], activation='relu')
Filters are set to 16 and strides to 2 to downsample the input by skipping pixels.
Fill all three blanks to create a Conv2D layer with 64 filters, kernel size 3, and 'same' padding.
conv = tf.keras.layers.Conv2D(filters=[1], kernel_size=[2], padding=[3], activation='relu')
Filters=64, kernel_size=3, and padding='same' keep output size equal to input size.