ONNX量化

ONNX量化

https://onnxruntime.ai/docs/performance/model-optimizations/quantization.html
Quantization Overview
Quantization in ONNX Runtime refers to 8 bit linear quantization of an ONNX model.

During quantization, the floating point values are mapped to an 8 bit quantization space of the form: val_fp32 = scale * (val_quantized - zero_point)

scale is a positive real number used to map the floating point numbers to a quantization space. It is calculated as follows:

For asymmetric quantization:

scale = (data_range_max - data_range_min) / (quantization_range_max - quantization_range_min)

For symmetric quantization:

scale = max(abs(data_range_max), abs(data_range_min)) * 2 / (quantization_range_max - quantization_range_min)

zero_point represents zero in the quantization space. It is important that the floating point zero value be exactly representable in quantization space. This is because zero padding is used in many CNNs. If it is not possible to represent 0 uniquely after quantization, it will result in accuracy errors.

相关推荐
Coovally AI模型快速验证3 分钟前
计算机视觉的 2026:从“堆算力”竞赛,到“省算力”智慧
人工智能·深度学习·算法·yolo·计算机视觉·无人机
软件测试君9 分钟前
2025年10款王炸AI测试工具,你用过几款?
自动化测试·软件测试·人工智能·深度学习·测试工具·单元测试·ai测试工具
Swift社区13 分钟前
AI赋能智汇高校 - 从零掌握大模型本地部署与微调全流程
人工智能·深度学习·语言模型
EW Frontier20 分钟前
【抗干扰】低SNR环境稳了!AWSPNet赋能MIMO雷达精准识别目标+抑制DRFM干扰【附python代码】
深度学习·目标识别·抗干扰·mimo雷达
名为沙丁鱼的猫72922 分钟前
【万文超详A2A 协议】从个体赋能到群体智能,智能体间的“TCP/IP协议“
人工智能·python·深度学习·机器学习·自然语言处理·nlp
Lian_Ge_Blog26 分钟前
prompt 工程学习总结
人工智能·深度学习·prompt
UR的出不克34 分钟前
基于机器学习的足球比赛预测系统 - 完整开发教程
人工智能·爬虫·python·深度学习·机器学习
石去皿38 分钟前
深度学习面试高频问题和答复
人工智能·深度学习·面试
shangjian00744 分钟前
AI大模型-深度学习-常见问题和解决方案
人工智能·深度学习
JicasdC123asd1 小时前
基于YOLOv10n-MambaOut的行李箱检测与识别系统_深度学习_Python_源码_详解
python·深度学习·yolo