컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: QuantizeDownAndShrinkRange
#include <math_ops.h>
다음을 사용하여 양자화된 '입력' 텐서를 낮은 정밀도의 '출력'으로 변환합니다.
요약
낮은 비트 깊이의 사용을 최대화하고 이에 따라 출력 최소 및 최대 범위를 조정하기 위해 값을 실제 분포합니다.
[input_min, input_max]는 '입력' 데이터의 부동 소수점 해석 범위를 지정하는 스칼라 부동 소수점입니다. 예를 들어 input_min이 -1.0f이고 input_max가 1.0f이고 quint16 양자화된 데이터를 처리하는 경우 16비트 데이터의 0 값은 -1.0f로 해석되어야 하며 65535는 1.0f를 의미합니다.
이 연산자는 데이터에서 발견된 실제 최소값과 최대값을 계산하여 비트 심도가 낮은 출력에 최대한 높은 정밀도를 적용하려고 합니다. 예를 들어, 해당 quint16 입력에는 16,384보다 낮은 값이 없고 49,152보다 높은 값이 없을 수 있습니다. 즉, 실제로는 범위의 절반만 필요하고 모든 부동 소수점 해석은 -0.5f에서 0.5f 사이이므로 데이터를 quint8 출력으로 압축하려면 이론적으로 -1.0f에서 1.0이 아닌 해당 범위를 사용할 수 있습니다. f는 입력 min과 max에 의해 제안됩니다.
실제로 이는 입력보다 더 높은 비트 심도 출력을 생성할 수 있고 잠재적 출력 범위가 클 수 있는 QuantizedMatMul 과 같은 작업에서 출력을 가져오는 데 가장 유용합니다. 그러나 실제로는 입력 값의 작은 부분만 사용하는 입력 값 분포가 있습니다. 가능한 범위. 해당 출력을 이 연산자에 입력하면 정확도 손실을 최소화하면서 출력을 32비트에서 8비트로 줄일 수 있습니다.
인수:
- 범위: 범위 개체
- input_min: 최소 양자화된 입력 값이 나타내는 부동 소수점 값입니다.
- input_max: 양자화된 최대 입력값이 나타내는 float 값입니다.
- out_type: 출력 유형입니다. Tinput보다 비트 깊이가 낮아야 합니다.
보고:
-
Output
출력 -
Output
출력_최소: 양자화된 최소 출력 값이 나타내는 부동 소수점 값입니다. -
Output
출력_최대: 양자화된 최대 출력 값이 나타내는 부동 소수점 값입니다.
공개 속성
공공 기능
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# tensorflow::ops::QuantizeDownAndShrinkRange Class Reference\n\ntensorflow::ops::QuantizeDownAndShrinkRange\n===========================================\n\n`#include \u003cmath_ops.h\u003e`\n\nConvert the quantized 'input' tensor into a lower-precision 'output', using the.\n\nSummary\n-------\n\nactual distribution of the values to maximize the usage of the lower bit depth and adjusting the output min and max ranges accordingly.\n\n\\[input_min, input_max\\] are scalar floats that specify the range for the float interpretation of the 'input' data. For example, if input_min is -1.0f and input_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f.\n\nThis operator tries to squeeze as much precision as possible into an output with a lower bit depth by calculating the actual min and max values found in the data. For example, maybe that quint16 input has no values lower than 16,384 and none higher than 49,152. That means only half the range is actually needed, all the float interpretations are between -0.5f and 0.5f, so if we want to compress the data into a quint8 output, we can use that range rather than the theoretical -1.0f to 1.0f that is suggested by the input min and max.\n\nIn practice, this is most useful for taking output from operations like [QuantizedMatMul](/versions/r2.2/api_docs/cc/class/tensorflow/ops/quantized-mat-mul#classtensorflow_1_1ops_1_1_quantized_mat_mul) that can produce higher bit-depth outputs than their inputs and may have large potential output ranges, but in practice have a distribution of input values that only uses a small fraction of the possible range. By feeding that output into this operator, we can reduce it from 32 bits down to 8 with minimal loss of accuracy.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input_min: The float value that the minimum quantized input value represents.\n- input_max: The float value that the maximum quantized input value represents.\n- out_type: The type of the output. Should be a lower bit depth than Tinput.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_min: The float value that the minimum quantized output value represents.\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_max: The float value that the maximum quantized output value represents.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [QuantizeDownAndShrinkRange](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a19ee578c7b888e9aca48d291a1a0d5da)`(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, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_min, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_max, DataType out_type)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a3ab13cf6f6f7814f990022d1a49b3a99) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a02ce18813489b86884040f42ddcfca87) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_max](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a3c2857dfc27b8777dc82845ec0a4919a) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_min](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1aa8dddbbd62576e4961029ce5ed846677) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\n### output_max\n\n```scdoc\n::tensorflow::Output output_max\n``` \n\n### output_min\n\n```scdoc\n::tensorflow::Output output_min\n``` \n\nPublic functions\n----------------\n\n### QuantizeDownAndShrinkRange\n\n```gdscript\n QuantizeDownAndShrinkRange(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input input_min,\n ::tensorflow::Input input_max,\n DataType out_type\n)\n```"]]