The is a very basic tensorflow question, but I haven't yet seen a clear explanation in the docs. Following the examples on the tensorflow site, we basically have these two layers connected:
conv1 = tf.layers.conv2d(
inputs=input_layer,
filters=32,
kernel_size=[5, 5],
padding="same",
activation=tf.nn.relu)
The shape at this point will be (28, 28, 32)
.
conv2 = tf.layers.conv2d(
inputs=conv1,
filters=64,
kernel_size=[5, 5],
padding="same",
activation=tf.nn.relu)
The shape at this point will be (28, 28, 64)
. How does tensorflow take the (28, 28, 32)
and turn it into (28, 28, 64)
using a 2d kernel. Could you please explain or point me to the documentation? How about when the output dimension of the second layer is smaller, say
conv2 = tf.layers.conv2d(
inputs=conv1,
filters=8,
kernel_size=[5, 5],
padding="same",
activation=tf.nn.relu)
How would tensorflow combine the 32 dimensions into 8?