Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
flux tensoriel : : opérations : : MaxPoolAvecArgmax
#include <nn_ops.h>
Effectue un pooling maximum sur l'entrée et génère à la fois les valeurs maximales et les indices.
Résumé
Les indices dans argmax
sont aplatis, de sorte qu'une valeur maximale à la position [b, y, x, c]
devienne un index aplati : (y * width + x) * channels + c
si include_batch_in_index
est False ; ((b * height + y) * width + x) * channels + c
si include_batch_in_index
est True.
Les indices renvoyés sont toujours dans [0, height) x [0, width)
avant aplatissement, même si un remplissage est impliqué et que la réponse mathématiquement correcte est à l'extérieur (soit négative, soit trop grande). Il s'agit d'un bug, mais il est difficile de le corriger de manière sécurisée et rétrocompatible, notamment en raison de l'aplatissement.
Arguments :
- scope : un objet Scope
- entrée : 4-D avec forme
[batch, height, width, channels]
. Entrée pour mettre en commun. - ksize : La taille de la fenêtre pour chaque dimension du tenseur d'entrée.
- foulées : la foulée de la fenêtre glissante pour chaque dimension du tenseur d'entrée.
- padding : Le type d’algorithme de remplissage à utiliser.
Attributs facultatifs (voir Attrs
) :
- include_batch_in_index : s'il faut inclure la dimension du lot dans l'index aplati de
argmax
.
Retours :
- Sortie
Output
: le tenseur de sortie regroupé maximum. - Argmax
Output
: 4-D. Les indices aplatis des valeurs maximales choisies pour chaque sortie.
Attributs publics
Fonctions publiques
MaxPoolAvecArgmax
MaxPoolWithArgmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
Fonctions statiques publiques
InclureBatchInIndex
Attrs IncludeBatchInIndex(
bool x
)
Targmax
Attrs Targmax(
DataType x
)
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[null,null,["Dernière mise à jour le 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```"]]