W3cubDocs

/TensorFlow C++

tensorflow::ops::FractionalAvgPool

#include <nn_ops.h>

Performs fractional average pooling on the input.

Summary

Fractional average pooling is similar to Fractional max pooling in the pooling region generation step. The only difference is that after pooling regions are generated, a mean operation is performed instead of a max operation in each pooling region.

Arguments:

  • scope: A Scope object
  • value: 4-D with shape [batch, height, width, channels].
  • pooling_ratio: Pooling ratio for each dimension of 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):

  • pseudo_random: When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin Graham, Fractional Max-Pooling for difference between pseudorandom and random.
  • overlapping: When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example:

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 [41/3, 26/3] for fractional avg pooling.

  • deterministic: When set to True, a fixed pooling region will be used when iterating over a FractionalAvgPool node in the computation graph. Mainly used in unit test to make FractionalAvgPool deterministic.
  • seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
  • seed2: An second seed to avoid seed collision.

Returns:

  • Output output: output tensor after fractional avg 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
FractionalAvgPool(const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio)
FractionalAvgPool(const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio, const FractionalAvgPool::Attrs & attrs)
Public attributes
col_pooling_sequence
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::FractionalAvgPool::Attrs

Optional attribute setters for FractionalAvgPool.

Public attributes

col_pooling_sequence

::tensorflow::Output col_pooling_sequence

output

::tensorflow::Output output

row_pooling_sequence

::tensorflow::Output row_pooling_sequence

Public functions

FractionalAvgPool

 FractionalAvgPool(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input value,
  const gtl::ArraySlice< float > & pooling_ratio
)

FractionalAvgPool

 FractionalAvgPool(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input value,
  const gtl::ArraySlice< float > & pooling_ratio,
  const FractionalAvgPool::Attrs & attrs
)

Public static functions

Deterministic

Attrs Deterministic(
  bool x
)

Overlapping

Attrs Overlapping(
  bool x
)

PseudoRandom

Attrs PseudoRandom(
  bool x
)

Seed

Attrs Seed(
  int64 x
)

Seed2

Attrs Seed2(
  int64 x
)

© 2017 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/api_docs/cc/class/tensorflow/ops/fractional-avg-pool.html