tf.nn.fractional_max_pool

View source on GitHub

Performs fractional max pooling on the input.

tf.nn.fractional_max_pool(
    value, pooling_ratio, pseudo_random=False, overlapping=False, seed=0, name=None
)

Fractional max pooling is slightly different than regular max pooling. In regular max pooling, you downsize an input set by taking the maximum value of smaller N x N subsections of the set (often 2x2), and try to reduce the set by a factor of N, where N is an integer. Fractional max pooling, as you might expect from the word "fractional", means that the overall reduction ratio N does not have to be an integer.

The sizes of the pooling regions are generated randomly but are fairly uniform. For example, let's look at the height dimension, and the constraints on the list of rows that will be pool boundaries.

First we define the following:

  1. input_row_length : the number of rows from the input set
  2. output_row_length : which will be smaller than the input
  3. alpha = input_row_length / output_row_length : our reduction ratio
  4. K = floor(alpha)
  5. row_pooling_sequence : this is the result list of pool boundary rows

Then, row_pooling_sequence should satisfy:

  1. a[0] = 0 : the first value of the sequence is 0
  2. a[end] = input_row_length : the last value of the sequence is the size
  3. K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
  4. length(row_pooling_sequence) = output_row_length+1

For more details on fractional max pooling, see this paper: Benjamin Graham, Fractional Max-Pooling

Args:

Returns:

A tuple of Tensor objects (output, row_pooling_sequence, col_pooling_sequence). output: Output Tensor after fractional max pooling. Has the same type as value. row_pooling_sequence: A Tensor of type int64. col_pooling_sequence: A Tensor of type int64.