Description
Return affine quantization reconstruction and residual.
Quantization maps continuous values to a discrete representation under a scale, offset and rounding policy. Reconstructing a supplied integer or comparing a value with a bin center measures one local error; it does not determine a quantizer’s range, select rounding or measure a model’s accuracy.
Return affine quantization reconstruction and residual.
When to use this tool
Use Quantization Zero Point Reconstruction Residual when checking the supplied reconstruction or bin-center error convention.
How to use the tool and how it works
- Enter original, quantized, zeroPoint, scale. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read reconstructed, residual. Use the output convention below.
Return affine quantization reconstruction and residual. Require scale > 0 and whole quantized/zeroPoint; reconstructed = scale*(quantized-zeroPoint), residual = original-reconstructed.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| original | Original | Required. Finite number. |
| quantized | Supplied integer representation; no implicit bit width or clipping range. | Required. Safe integer. |
| zeroPoint | Zero Point | Required. Safe integer. |
| scale | Positive reconstruction increment per integer step. | Required. Finite number; strictly above 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| reconstructed | Reconstructed | Required. Finite number. |
| residual | original minus reconstructed, in original-value units. | Required. Finite number. |
{
"input": {
"original": 1.2,
"quantized": 15,
"zeroPoint": 3,
"scale": 0.1
},
"output": {
"reconstructed": 1.2000000000000002,
"residual": -2.220446049250313e-16
}
} Limitations and assumptions
- No quantized range, clipping policy or learned scale is inferred; this reconstructs one supplied entry rather than quantizing a tensor.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the complete quantizer configuration and representative data for clipping, rounding, calibration and model-level error analysis.
References
Similar or alternative tools
- Quantization Bin Center Error
Return a value's bin-center error and relative-width ratio.
- Quantized Weight Zero Point Code
Subtract an explicit quantization zero point from an in-range integer weight code without estimating scale.