コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦::小数平均プール
#include <nn_ops.h>
入力に対して部分平均プーリングを実行します。
まとめ
フラクショナル平均プーリングは、プーリング領域生成ステップにおけるフラクショナル最大プーリングに似ています。唯一の違いは、プーリング領域が生成された後、各プーリング領域で最大演算の代わりに平均演算が実行されることです。
引数:
- スコープ:スコープオブジェクト
- 値: 形状
[batch, height, width, channels]
の 4-D。 - pooling_ratio:
value
の各次元のプーリング比率。現在は行次元と列次元のみをサポートしており、1.0 以上である必要があります。たとえば、有効なプーリング率は [1.0, 1.44, 1.73, 1.0] のようになります。バッチおよびチャネル ディメンションでのプーリングが許可されていないため、最初と最後の要素は 1.0 である必要があります。 1.44 と 1.73 は、それぞれ高さと幅の寸法のプーリング率です。
オプションの属性 ( Attrs
を参照):
- pseudo_random: True に設定すると、擬似ランダム方式でプーリング シーケンスが生成され、それ以外の場合はランダム方式でプーリング シーケンスが生成されます。擬似ランダムとランダムの違いについては、Benjamin Graham、Fractional Max-Pooling の論文を確認してください。
- 重複: True に設定すると、プーリング時に、隣接するプーリング セルの境界にある値が両方のセルで使用されることを意味します。例えば:
index 0 1 2 3 4
value 20 5 16 3 7
プーリング シーケンスが [0, 2, 4] の場合、インデックス 2 の 16 が 2 回使用されます。部分平均プーリングの場合、結果は [41/3, 26/3] になります。
- deterministic: True に設定すると、計算グラフ内のFractionalAvgPoolノードを反復するときに固定プーリング領域が使用されます。主に単体テストでFractionalAvgPoolを決定的にするために使用されます。
- シード: シードまたはシード 2 のいずれかが 0 以外に設定されている場合、乱数ジェネレーターには指定されたシードがシードされます。それ以外の場合は、ランダム シードによってシードされます。
- seed2: シードの衝突を避けるための 2 番目のシード。
戻り値:
-
Output
出力: 部分平均プーリング後の出力テンソル。 -
Output
row_pooling_sequence: 勾配の計算に必要な行プーリング シーケンス。 -
Output
col_pooling_sequence: 勾配の計算に必要な列プーリング シーケンス。
パブリック属性
公共機能
パブリック静的関数
決定論的
Attrs Deterministic(
bool x
)
重複
Attrs Overlapping(
bool x
)
擬似ランダム
Attrs PseudoRandom(
bool x
)
シード2
Attrs Seed2(
int64 x
)
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 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\nArguments:\n\n- scope: A [Scope](/versions/r2.1/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.1/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.1/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.1/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.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output: output tensor after fractional avg pooling.\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) row_pooling_sequence: row pooling sequence, needed to calculate gradient.\n- [Output](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value, const gtl::ArraySlice\u003c float \u003e & pooling_ratio, const `[FractionalAvgPool::Attrs](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a8b1bbb7c981afe922b39753597ab754b) | [Operation](/versions/r2.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs) | Optional attribute setters for [FractionalAvgPool](/versions/r2.1/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```"]]