How to make a global middle pool in TensorFlow?

How to make a global middle pool in TensorFlow? If I have a form tensor batch_size, height, width, channels = 32, 11, 40, 100, is it easy enough to use tf.layers.average_pooling2d(x, [11, 40], [11, 40])as long as channels = classes?

+4
source share
2 answers

You do not need to go a step. If padding = 'valid' (default), if the spatial scale of the combining filter matches the spatial extent of the image, you will get a 1x1 image. Besides, that’s how you do it, yes.

0
source

You can also do tf.reduce_mean (x, [1,2]) , especially if your height and width are not defined.

+11
source

Source: https://habr.com/ru/post/1668873/


All Articles