จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: FractionalAvgPool
#include <nn_ops.h>
ดำเนินการรวมค่าเฉลี่ยเศษส่วนกับอินพุต
สรุป
การรวมเศษส่วนเฉลี่ยจะคล้ายกับการรวมเศษส่วนสูงสุดในขั้นตอนการสร้างขอบเขตการรวม ข้อแตกต่างเพียงอย่างเดียวคือหลังจากสร้างขอบเขตการรวมกลุ่มแล้ว การดำเนินการเฉลี่ยจะถูกดำเนินการแทนการดำเนินการสูงสุดในแต่ละขอบเขตการรวมกลุ่ม
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- ค่า: 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
- เมล็ด: หากเมล็ดใดเมล็ดหนึ่งหรือเมล็ด 2 ถูกตั้งค่าไม่เป็นศูนย์ เครื่องกำเนิดตัวเลขสุ่มจะถูกเพาะโดยเมล็ดที่กำหนด มิฉะนั้นจะถูกเพาะโดยเมล็ดแบบสุ่ม
- seed2: เมล็ดที่สองเพื่อหลีกเลี่ยงการชนกันของเมล็ด
ผลตอบแทน:
- เอาท์พุต
Output
: เทนเซอร์เอาท์พุตหลังการรวมเศษส่วนเฉลี่ย -
Output
row_pooling_sequence: ลำดับการรวมแถว จำเป็นสำหรับการคำนวณการไล่ระดับสี -
Output
col_pooling_sequence: ลำดับการรวมคอลัมน์ จำเป็นสำหรับการคำนวณการไล่ระดับสี
คุณลักษณะสาธารณะ
งานสาธารณะ
ฟังก์ชันคงที่สาธารณะ
กำหนดไว้
Attrs Deterministic(
bool x
)
ทับซ้อนกัน
Attrs Overlapping(
bool x
)
หลอกสุ่ม
Attrs PseudoRandom(
bool x
)
เมล็ดพันธุ์
Attrs Seed(
int64 x
)
เมล็ดพันธุ์2
Attrs Seed2(
int64 x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 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.0/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.0/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.0/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.0/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.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output: output tensor after fractional avg pooling.\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) row_pooling_sequence: row pooling sequence, needed to calculate gradient.\n- [Output](/versions/r2.0/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.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/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.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value, const gtl::ArraySlice\u003c float \u003e & pooling_ratio, const `[FractionalAvgPool::Attrs](/versions/r2.0/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.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a8b1bbb7c981afe922b39753597ab754b) | [Operation](/versions/r2.0/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.0/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.0/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.0/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.0/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.0/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.0/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.0/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.0/api_docs/cc/struct/tensorflow/ops/fractional-avg-pool/attrs) | Optional attribute setters for [FractionalAvgPool](/versions/r2.0/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```"]]