#include <nn_ops.h>
Performs fractional max pooling on the input.
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:
Then, row_pooling_sequence should satisfy:
For more details on fractional max pooling, see this paper: Benjamin Graham, Fractional Max-Pooling
Arguments:
[batch, height, width, channels]
.value
, currently only supports row and col dimension and should be >= 1.0. For example, a valid pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements must be 1.0 because we don't allow pooling on batch and channels dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions respectively.Optional attributes (see Attrs
):
index 0 1 2 3 4
value 20 5 16 3 7
If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [20, 16] for fractional max pooling.
Returns:
Output
output: output tensor after fractional max pooling.Output
row_pooling_sequence: row pooling sequence, needed to calculate gradient.Output
col_pooling_sequence: column pooling sequence, needed to calculate gradient. Constructors and Destructors | |
---|---|
FractionalMaxPool(const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio) | |
FractionalMaxPool(const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio, const FractionalMaxPool::Attrs & attrs) |
Public attributes | |
---|---|
col_pooling_sequence | |
operation | |
output | |
row_pooling_sequence |
Public static functions | |
---|---|
Deterministic(bool x) | |
Overlapping(bool x) | |
PseudoRandom(bool x) | |
Seed(int64 x) | |
Seed2(int64 x) |
Structs | |
---|---|
tensorflow::ops::FractionalMaxPool::Attrs | Optional attribute setters for FractionalMaxPool. |
::tensorflow::Output col_pooling_sequence
Operation operation
::tensorflow::Output output
::tensorflow::Output row_pooling_sequence
FractionalMaxPool( const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio )
FractionalMaxPool( const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio, const FractionalMaxPool::Attrs & attrs )
Attrs Deterministic( bool x )
Attrs Overlapping( bool x )
Attrs PseudoRandom( bool x )
Attrs Seed( int64 x )
Attrs Seed2( int64 x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/fractional-max-pool