Max pool

The following defined function provides max pooling for the input 4D tensor tf.nn.max_pool:

max_pool(  value, ksize, strides, padding, data_format='NHWC', name=None)

The preceding arguments are explained here:

  • value: This is the 4D tensor with shape [batch, height, width, channels], type tf.float32 on which max pooling needs to be done.
  • ksize: This is the list of ints that has length >= 4. The size of the window for each dimension of the input tensor.
  • strides: This is the list of ints, length >= 4. A stride of the sliding window for each dimension of the input tensor.
  • padding: This is a string, either VALID or SAME. The padding algorithm. The following section explains VALID and SAME padding.

Get Neural Network Programming with TensorFlow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.