I don't really understand Keras Conv2D output if I have a 1X2X3X3 input (I am using channel first) and weights 2X2X2X2 as in the following image, can someone help me to understand the output feature map, how do the filters convolve over the input to get the output?
Here is my code:
import os
import tensorflow as to
import tensorflow.python.util.deprecation as deprecation
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Conv1D, Conv2D
data = tf.range(3 * 3 * 2)
print(data)
data = tf.reshape(data, (1, 2, 3, 3))
print(data)
print('-------')
e = tf.range(2 * 2 * 2 * 2)
print(e)
e = tf.reshape(e, (2, 2, 2, 2))
print(e)
print('-------')
model = Sequential()
model.add(Conv2D(2, (2, 2), input_shape=(2, 3, 3), data_format='channels_first'))
weights = [e, tf.constant([0.0,0.0])]
model.set_weights(weights)
print(model.get_weights())
yhat = model.predict(data)
print(yhat.shape)
print(yhat)

