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.

相关推荐
陈嘿萌2 小时前
TPAMI 2026 | 多模态自监督只做对齐够吗?MIIB同时学习冗余、独有与协同信息机制
图像处理·人工智能·深度学习·计算机视觉·学术研究与理论基础
I Am a robert girl5 小时前
DiffRAC:当视频“呼吸”有了节拍器——重复动作计数的新范式
python·深度学习·计算机视觉·视频分析·视频扩散模型·重复动作计数
Zzj_tju10 小时前
总体分数之外,问答错误集中在哪里?
人工智能·深度学习·语言模型·自然语言处理
布吉岛的石头12 小时前
Java 程序员第 52 阶段8:Prompt 约束:限定范围与格式
人工智能·深度学习·transformer
I Am a robert girl14 小时前
Scaffold3D:当神经网络开始“请教”传统几何学家
人工智能·深度学习·神经网络·计算机视觉·3d·3d重建·几何约束
qq_252941316814 小时前
无人机山体滑坡目标检测数据集|1575张 640×640 YOLO格式:深度学习 目标检测 无人机巡检 山体滑坡 地质灾害 YOLO格式 数据集发布9092期
深度学习·目标检测·无人机
Blueeyedboy52118 小时前
工业算法全景:从统计分析到深度学习,火电厂场景下的分类、训练与选型指南
深度学习·机器学习·工业互联网·时间序列预测·火电厂
程序猿追1 天前
HarmonyOS 7 多标签草稿,关掉当前页之后该留下谁
pytorch·深度学习·harmonyos
code2cat1 天前
【随笔】打印第11页突然变慢,ReLU怎样让预测拐个弯?
人工智能·深度学习·机器学习
小糖学代码1 天前
LLM系列:4.transformer算法:4.NLTK(补充)
深度学习·算法·transformer