I'm having a lot of problems to understand numpy array shape.
If have a numpy array with shape (1, 12, 12, 512), does it means?
- I have 512 arrays of shape
(1, 12, 12). - I have one array of shape
(12, 12, 512)
What does it means?
By the way, this numpy array is a feature map from an encoder CNN model.
If I use tf.keras.layers.GlobalAveragePooling2D with that feature map, I get a Tensor with shape (1, 512) that is what it makes me doubt.
To show a simplest array and try to understand it, I have used this code:
x = tf.constant([[1., 2., 3.],
[4., 5., 6.]])
y = tf.reshape(x, [1, 2, 3, 1])
x array is:
array([[1., 2., 3.],
[4., 5., 6.]], dtype=float32)
y array is:
array([[[[1.],
[2.],
[3.]],
[[4.],
[5.],
[6.]]]], dtype=float32)
So I think is the second option, but I'm not sure.