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.

相关推荐
林间码客15 小时前
《人工智能概论》实验4 知识点复习提纲
人工智能·深度学习·机器学习
chloe233315 小时前
【动手学深度学习】笔记1:简单的线性回归
笔记·深度学习·线性回归
钓了猫的鱼儿15 小时前
基于深度学习+AI的秸秆目标检测与预警系统(Python源码+数据集+UI可视化界面+YOLOv11训练结果)
人工智能·深度学习·目标检测
人工智能培训15 小时前
从GPT到开源大模型
人工智能·gpt·深度学习·机器学习·容器·知识图谱
Kobebryant-Manba16 小时前
学习参数管理
pytorch·python·深度学习
AI人工智能+16 小时前
药品注册证识别技术利用深度学习和多模态融合架构,实现药品注册证信息的自动化精准提取
深度学习·语言模型·自然语言处理·ocr·药品注册证识别
keykey6.16 小时前
LSTM 文本情感分析:从词嵌入到分类实战
开发语言·人工智能·深度学习·机器学习
惊鸿一博16 小时前
图像修复_MPMF-Net中的“多维特征交互块”(Multi-dimension Feature Interaction Block, MFIB)
图像处理·深度学习
大模型最新论文速读16 小时前
06-08 · LLM 最新论文速览
论文阅读·人工智能·深度学习·机器学习·自然语言处理
是Dream呀16 小时前
通道注意力机制|Channel Attention Neural Network
人工智能·python·深度学习