tensorflow:: אופס:: FractionalAvgPool
#include <nn_ops.h>
מבצע איגום ממוצע חלקי על הקלט.
תַקצִיר
איגום ממוצע חלקי דומה לאיסוף מרבי חלקי בשלב יצירת אזור האיגום. ההבדל היחיד הוא שלאחר יצירת אזורי איסוף, מתבצעת פעולה ממוצעת במקום פעולת מקסימום בכל אזור איגום.
טיעונים:
- scope: אובייקט Scope
- ערך: 4-D עם צורה
[batch, height, width, channels]
. - 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], אז 16, באינדקס 2 ישמש פעמיים. התוצאה תהיה [41/3, 26/3] עבור איגום ממוצע חלקי.
- דטרמיניסטית: כאשר מוגדר כ-True, אזור איגוד קבוע ישמש בעת איטרציה על צומת FractionalAvgPool בגרף החישוב. משמש בעיקר בבדיקת יחידה כדי להפוך את FractionalAvgPool לדטרמיניסטית.
- seed: אם ה-seed או seed2 מוגדרים להיות לא-אפס, מחולל המספרים האקראיים מוזרע על ידי ה-seed הנתון. אחרת, הוא נזרע על ידי זרע אקראי.
- seed2: זרע שני כדי למנוע התנגשות זרע.
החזרות:
-
Output
: טנזור פלט לאחר איגום ממוצע חלקי. -
Output
row_pooling_sequence: רצף אוסף שורות, הדרוש לחישוב שיפוע. -
Output
col_pooling_sequence: רצף איגום עמודות, הדרוש לחישוב שיפוע.
בנאים והורסים | |
---|---|
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) |
תכונות ציבוריות | |
---|---|
col_pooling_sequence | |
operation | |
output | |
row_pooling_sequence |
פונקציות סטטיות ציבוריות | |
---|---|
Deterministic (bool x) | |
Overlapping (bool x) | |
PseudoRandom (bool x) | |
Seed (int64 x) | |
Seed2 (int64 x) |
מבנים | |
---|---|
tensorflow:: ops:: FractionalAvgPool:: Attrs | קובעי תכונות אופציונליים עבור FractionalAvgPool . |
תכונות ציבוריות
col_pooling_sequence
::tensorflow::Output col_pooling_sequence
מִבצָע
Operation operation
תְפוּקָה
::tensorflow::Output output
row_pooling_sequence
::tensorflow::Output row_pooling_sequence
תפקידים ציבוריים
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 )
פונקציות סטטיות ציבוריות
דטרמיניסטי
Attrs Deterministic( bool x )
חוֹפֵף
Attrs Overlapping( bool x )
פסאודו רנדום
Attrs PseudoRandom( bool x )
זֶרַע
Attrs Seed( int64 x )
זרע 2
Attrs Seed2( int64 x )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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```"]]