In [1]:
import tensorflow as tf
input = tf.placeholder(tf.float32, (None, 4, 4, 5))
filter_shape = [1, 2, 2, 1]
strides = [1, 2, 2, 1]
padding = 'VALID'
pool = tf.nn.max_pool(input, filter_shape, strides, padding)

In [3]:
print(pool)


Tensor("MaxPool:0", shape=(?, 2, 2, 5), dtype=float32)

In [4]:
import numpy as np
print(np.mean([0,1,2,2.5]))
print(np.mean([0.5,10,1,-8]))
print(np.mean([4,0,15,1]))
print(np.mean([5,6,2,3]))


1.375
0.875
5.0
4.0

In [ ]:


In [ ]: