จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: MaxPoolWithArgmax
#include <nn_ops.h>
ดำเนินการรวมค่าสูงสุดกับอินพุตและเอาต์พุตทั้งค่าสูงสุดและดัชนี
สรุป
ดัชนีใน argmax
ถูกทำให้ราบเรียบ ดังนั้นค่าสูงสุดที่ตำแหน่ง [b, y, x, c]
จะกลายเป็นดัชนีที่ราบเรียบ: (y * width + x) * channels + c
ถ้า include_batch_in_index
เป็นเท็จ; ((b * height + y) * width + x) * channels + c
ถ้า include_batch_in_index
เป็น True
ดัชนีที่ส่งคืนจะอยู่ใน [0, height) x [0, width)
เสมอก่อนที่จะทำให้แบน แม้ว่าจะเกี่ยวข้องกับการเติมและคำตอบที่ถูกต้องทางคณิตศาสตร์อยู่ด้านนอก (อาจเป็นลบหรือใหญ่เกินไป) นี่เป็นจุดบกพร่อง แต่การแก้ไขนั้นทำได้ยากด้วยวิธีที่เข้ากันได้แบบย้อนหลังอย่างปลอดภัย โดยเฉพาะอย่างยิ่งเนื่องจากการแบน
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- อินพุต: 4-D ที่มีรูปร่าง
[batch, height, width, channels]
ป้อนข้อมูล ไปยังพูลมากกว่า - ksize: ขนาดของหน้าต่างสำหรับแต่ละมิติของเทนเซอร์อินพุต
- ความก้าวหน้า: ก้าวของหน้าต่างบานเลื่อนสำหรับแต่ละมิติของเทนเซอร์อินพุต
- padding: ประเภทของอัลกอริธึมการเติมที่จะใช้
แอ็ตทริบิวต์ทางเลือก (ดู Attrs
):
- include_batch_in_index: ว่าจะรวมมิติข้อมูลแบทช์ในดัชนีที่ราบเรียบของ
argmax
หรือไม่
ผลตอบแทน:
- เอาท์พุต
Output
: เทนเซอร์เอาท์พุตพูลสูงสุด -
Output
สูงสุด: 4-D ดัชนีแบบแบนของค่าสูงสุดที่เลือกสำหรับแต่ละเอาต์พุต
คุณลักษณะสาธารณะ
งานสาธารณะ
MaxPoolWithArgmax
MaxPoolWithArgmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
ฟังก์ชันคงที่สาธารณะ
รวม BatchInIndex
Attrs IncludeBatchInIndex(
bool x
)
ทาร์กแม็กซ์
Attrs Targmax(
DataType x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# tensorflow::ops::MaxPoolWithArgmax Class Reference\n\ntensorflow::ops::MaxPoolWithArgmax\n==================================\n\n`#include \u003cnn_ops.h\u003e`\n\nPerforms max pooling on the input and outputs both max values and indices.\n\nSummary\n-------\n\nThe indices in `argmax` are flattened, so that a maximum value at position `[b, y, x, c]` becomes flattened index: `(y * width + x) * channels + c` if `include_batch_in_index` is False; `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True.\n\nThe indices returned are always in `[0, height) x [0, width)` before flattening, even if padding is involved and the mathematically correct answer is outside (either negative or too large). This is a bug, but fixing it is difficult to do in a safe backwards compatible way, especially due to flattening.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: 4-D with shape `[batch, height, width, channels]`. [Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input) to pool over.\n- ksize: The size of the window for each dimension of the input tensor.\n- strides: The stride of the sliding window for each dimension of the input tensor.\n- padding: The type of padding algorithm to use.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs)):\n\n- include_batch_in_index: Whether to include batch dimension in flattened index of `argmax`.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output: The max pooled output tensor.\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) argmax: 4-D. The flattened indices of the max values chosen for each output.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [MaxPoolWithArgmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1abb51fa41db084247e489859748d89eec)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, const gtl::ArraySlice\u003c int \u003e & ksize, const gtl::ArraySlice\u003c int \u003e & strides, StringPiece padding)` ||\n| [MaxPoolWithArgmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a0c2a8005c65f80a0714ab13c31ac9b4a)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, const gtl::ArraySlice\u003c int \u003e & ksize, const gtl::ArraySlice\u003c int \u003e & strides, StringPiece padding, const `[MaxPoolWithArgmax::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [argmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a3ee6b2270133581582b335bb54c206cd) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1ad70c7f4c8878ff933f05f49d914b32c5) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1ae10e4e4c026e2fb47004e52ccae14cd5) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [IncludeBatchInIndex](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a4e5f3eabc676bb9818da7a13ed74280d)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs) |\n| [Targmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a42ae4bbc217faf11615e6e2248886754)`(DataType x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs) |\n\n| ### Structs ||\n|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::MaxPoolWithArgmax::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/max-pool-with-argmax/attrs) | Optional attribute setters for [MaxPoolWithArgmax](/versions/r2.2/api_docs/cc/class/tensorflow/ops/max-pool-with-argmax#classtensorflow_1_1ops_1_1_max_pool_with_argmax). |\n\nPublic attributes\n-----------------\n\n### argmax\n\n```text\n::tensorflow::Output argmax\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### MaxPoolWithArgmax\n\n```gdscript\n MaxPoolWithArgmax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n const gtl::ArraySlice\u003c int \u003e & ksize,\n const gtl::ArraySlice\u003c int \u003e & strides,\n StringPiece padding\n)\n``` \n\n### MaxPoolWithArgmax\n\n```gdscript\n MaxPoolWithArgmax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n const gtl::ArraySlice\u003c int \u003e & ksize,\n const gtl::ArraySlice\u003c int \u003e & strides,\n StringPiece padding,\n const MaxPoolWithArgmax::Attrs & attrs\n)\n``` \n\nPublic static functions\n-----------------------\n\n### IncludeBatchInIndex\n\n```text\nAttrs IncludeBatchInIndex(\n bool x\n)\n``` \n\n### Targmax\n\n```text\nAttrs Targmax(\n DataType x\n)\n```"]]