Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
тензорный поток:: опс:: Макспулвисаргмакс
#include <nn_ops.h>
Выполняет максимальное объединение входных данных и выводит как максимальные значения, так и индексы.
Краткое содержание
Индексы в argmax
сглаживаются, так что максимальное значение в позиции [b, y, x, c]
становится сглаженным индексом: (y * width + x) * channels + c
если include_batch_in_index
имеет значение False; ((b * height + y) * width + x) * channels + c
если include_batch_in_index
имеет значение True.
Возвращаемые индексы всегда имеют размер [0, height) x [0, width)
до выравнивания, даже если используется заполнение и математически правильный ответ находится снаружи (отрицательный или слишком большой). Это ошибка, но ее трудно исправить безопасным способом с обратной совместимостью, особенно из-за сглаживания.
Аргументы:
- область: объект области.
- ввод: 4-D с формой
[batch, height, width, channels]
. Вход в пул окончен. - ksize: Размер окна для каждого измерения входного тензора.
- шаги: шаг скользящего окна для каждого измерения входного тензора.
- дополнение: тип используемого алгоритма заполнения.
Необязательные атрибуты (см. Attrs
):
- include_batch_in_index: включать ли измерение пакета в сведенный индекс
argmax
.
Возврат:
-
Output
результат: максимальный объединенный выходной тензор. -
Output
аргументмакс: 4-D. Сглаженные индексы максимальных значений, выбранных для каждого выхода.
Публичные атрибуты
Общественные функции
Макспулвисаргмакс
MaxPoolWithArgmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
Публичные статические функции
Инклудбатчининдекс
Attrs IncludeBatchInIndex(
bool x
)
Таргмакс
Attrs Targmax(
DataType x
)
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. 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```"]]