I am trying to understand the output of a 1D convolution layer applied on a number of batches (3 in this case) of 2D input shapes (6x6).
The output of the code below is (4, 10, 32). This answer is quite straight-forward for the first 2 indices.
- (4) We plug in N examples, we get out N examples.
- (8) When doing the convolution between a (10, 128) * (3, 1) and because the default padding is set to "valid", two of the values in our input space won't be mapped to our final result, that's why we get 8.
- I don't understand why the layer outputs 32 as the final index. What is the actual role of the
filtersargument in the Conv1D layer? It's not really intuitive for me how does the layer operates the final output as stated by the phrase down below.
By the documentation this should be the output shape
Output shape: 3+D tensor with shape: batch_shape + (new_steps, filters) steps value might have changed due to padding or strides.
input_shape = (4, 10, 128)
x = tf.random.normal(input_shape)
y = tf.keras.layers.Conv1D(
32, 3, input_shape=input_shape[1:])(x)
print(y.shape) # (4, 10, 32)

