Stay organized with collections
Save and categorize content based on your preferences.
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.
Args:
- 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.
Public attributes
Public functions
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
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::FractionalAvgPool Class Reference\n\ntensorflow::ops::FractionalAvgPool\n==================================\n\n`#include \u003cnn_ops.h\u003e`\n\nPerforms fractional average pooling on the input.\n\nSummary\n-------\n\nFractional 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.\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- value: 4-D with shape `[batch, height, width, channels]`.\n- pooling_ratio: Pooling ratio for each dimension of `value`, currently only supports row and col dimension and should be \\\u003e= 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.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)):\n\n- 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](http://arxiv.org/abs/1412.6071) for difference between pseudorandom and random.\n- 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:\n\n\u003cbr /\u003e\n\n\n`index 0 1 2 3 4`\n\n\n`value 20 5 16 3 7`\n\nIf 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.\n\n- deterministic: When set to True, a fixed pooling region will be used when iterating over a [FractionalAvgPool](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool) node in the computation graph. Mainly used in unit test to make [FractionalAvgPool](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool) deterministic.\n- 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.\n- seed2: An second seed to avoid seed collision.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output: output tensor after fractional avg pooling.\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) row_pooling_sequence: row pooling sequence, needed to calculate gradient.\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) col_pooling_sequence: column pooling sequence, needed to calculate gradient.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [FractionalAvgPool](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a83af6f6e93dbac2bf42ad6afc05d2a86)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value, const gtl::ArraySlice\u003c float \u003e & pooling_ratio)` ||\n| [FractionalAvgPool](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1afe59c1134290e6cfe190960e53e836ed)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value, const gtl::ArraySlice\u003c float \u003e & pooling_ratio, const `[FractionalAvgPool::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [col_pooling_sequence](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a253a9b7940b383f04c70aa5254f52995) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a8b1bbb7c981afe922b39753597ab754b) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a72c1fe35152d17096cfcd5ca3d626e24) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [row_pooling_sequence](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1aef40ec50b456803bb75a8474cdc29fcb) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Deterministic](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a286c7e7d0ea4b667eb0fca780f6c8fd8)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs) |\n| [Overlapping](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a561400c14f7e0877122cf0faad67b785)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs) |\n| [PseudoRandom](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1aaeb0a37c716692070fa056b6f164adab)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs) |\n| [Seed](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a691079eab5c004dc817e928c12380fe5)`(int64 x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs) |\n| [Seed2](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1aba6caf6e7f50e68e728b8ac9357b9353)`(int64 x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs) |\n\n| ### Structs ||\n|--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::FractionalAvgPool::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs) | Optional attribute setters for [FractionalAvgPool](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool). |\n\nPublic attributes\n-----------------\n\n### col_pooling_sequence\n\n```scdoc\n::tensorflow::Output col_pooling_sequence\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\n### row_pooling_sequence\n\n```scdoc\n::tensorflow::Output row_pooling_sequence\n``` \n\nPublic functions\n----------------\n\n### FractionalAvgPool\n\n```gdscript\n FractionalAvgPool(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input value,\n const gtl::ArraySlice\u003c float \u003e & pooling_ratio\n)\n``` \n\n### FractionalAvgPool\n\n```gdscript\n FractionalAvgPool(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input value,\n const gtl::ArraySlice\u003c float \u003e & pooling_ratio,\n const FractionalAvgPool::Attrs & attrs\n)\n``` \n\nPublic static functions\n-----------------------\n\n### Deterministic\n\n```text\nAttrs Deterministic(\n bool x\n)\n``` \n\n### Overlapping\n\n```text\nAttrs Overlapping(\n bool x\n)\n``` \n\n### PseudoRandom\n\n```text\nAttrs PseudoRandom(\n bool x\n)\n``` \n\n### Seed\n\n```text\nAttrs Seed(\n int64 x\n)\n``` \n\n### Seed2\n\n```text\nAttrs Seed2(\n int64 x\n)\n```"]]