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.

相关推荐
数聚天成DeepSData12 小时前
验收一批标注数据时,一致性到底在比谁和谁
人工智能·深度学习·机器学习·数据集·deepsdata
迷途呀13 小时前
强化学习概念
人工智能·深度学习·机器学习·强化学习·1024程序员节
m0_6220235313 小时前
产业资本运作:新金融博弈下的产业链安全底盘搭建
大数据·深度学习·重构·1024程序员节
zhenaibo52113 小时前
开题报告如何选择研究方法?为什么很重要?
深度学习
鬼手点金15 小时前
从 API 消息到模型 Token:Chat Template
java·前端·javascript·数据库·人工智能·深度学习·1024程序员节
在所不辞兄15 小时前
【零基础学智能仿真-61】DFT数值收敛与计算预算
人工智能·深度学习·神经网络·机器学习·1024程序员节
IT研究室15 小时前
最新计算机毕业设计选题推荐-基于深度学习的面部关键特征识别与检测-运行部署-文档指导-深度学习-YOLO
人工智能·深度学习·yolo·课程设计
Jsundoku16 小时前
第六章 深度学习 -- 循环神经网络
人工智能·深度学习·循环神经网络·1024程序员节
拓恒技术17 小时前
内河航道无人机智能巡检系统与算法应用
人工智能·深度学习·算法·无人机·智慧城市
Jsundoku18 小时前
第七章 深度学习 -- Transformer 架构
人工智能·深度学习·transformer·1024程序员节