tf.raw_ops.FractionalAvgPool
Stay organized with collections
Save and categorize content based on your preferences.
Performs fractional average pooling on the input.
tf.raw_ops.FractionalAvgPool(
value,
pooling_ratio,
pseudo_random=False,
overlapping=False,
deterministic=False,
seed=0,
seed2=0,
name=None
)
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 |
value
|
A Tensor . Must be one of the following types: float32 , float64 , int32 , int64 .
4-D with shape [batch, height, width, channels] .
|
pooling_ratio
|
A list of floats that has length >= 4 .
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.
|
pseudo_random
|
An optional bool . Defaults to False .
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
|
An optional bool . Defaults to False .
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
|
An optional bool . Defaults to False .
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
|
An optional int . Defaults to 0 .
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 optional int . Defaults to 0 .
An second seed to avoid seed collision.
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (output, row_pooling_sequence, col_pooling_sequence).
|
output
|
A Tensor . Has the same type as value .
|
row_pooling_sequence
|
A Tensor of type int64 .
|
col_pooling_sequence
|
A Tensor of type int64 .
|
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 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.FractionalAvgPool\n\n\u003cbr /\u003e\n\nPerforms fractional average pooling on the input.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.FractionalAvgPool`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/FractionalAvgPool)\n\n\u003cbr /\u003e\n\n tf.raw_ops.FractionalAvgPool(\n value,\n pooling_ratio,\n pseudo_random=False,\n overlapping=False,\n deterministic=False,\n seed=0,\n seed2=0,\n name=None\n )\n\nFractional average pooling is similar to Fractional max pooling in the pooling\nregion generation step. The only difference is that after pooling regions are\ngenerated, a mean operation is performed instead of a max operation in each\npooling region.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`. 4-D with shape `[batch, height, width, channels]`. |\n| `pooling_ratio` | A list of `floats` that has length `\u003e= 4`. 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| `pseudo_random` | An optional `bool`. Defaults to `False`. 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` | An optional `bool`. Defaults to `False`. When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example: \u003cbr /\u003e `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. |\n| `deterministic` | An optional `bool`. Defaults to `False`. 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. |\n| `seed` | An optional `int`. Defaults to `0`. 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 optional `int`. Defaults to `0`. An second seed to avoid seed collision. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|------------------------|-------------------------------------------|\n| A tuple of `Tensor` objects (output, row_pooling_sequence, col_pooling_sequence). ||\n| `output` | A `Tensor`. Has the same type as `value`. |\n| `row_pooling_sequence` | A `Tensor` of type `int64`. |\n| `col_pooling_sequence` | A `Tensor` of type `int64`. |\n\n\u003cbr /\u003e"]]