当前位置:网站首页>BN folding and its quantification
BN folding and its quantification
2022-07-06 08:56:00 【cyz0202】
This paper introduces the process of quantification BN Fold ;
The following pictures are quoted from Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference
BN Fold
First introduced BN Fold ;BN Folding comes from BN The implementation difference between the training phase and the inference phase of the module ;
As shown in the figure below : With conv+BN For example , chart 1 For the training stage BN, chart 2 For the inferential stage BN


It can be proved that such folding is reasonable , Pay attention to the picture 2 Medium w It refers to the convolution kernel ;

In quantification BN Fold
For quantification , Especially quantitative perception ( Pseudo quantization ), We need to keep the pseudo quantization in the training stage and the above figure 2 The quantitative implementation of the inference phase of is consistent , Therefore, for the training stage CONV+BN Fold in two steps , Here's the picture 3:

chart 3 Our design idea comes from figure 2, The basic idea is to seek
Of EMA( In the picture moment And the steps before and after ) After taking it off, you should match the picture 2 Agreement ;
According to the figure 3 Shown BN Fold , You can do post training quantification or pseudo quantification of the folding in the training stage , Here's the picture 4

Code implementation
The following code block is from github distiller, There is no complete context implementation , Interested readers can read step by step

summary
- The above is a brief introduction to BN Folding and its quantification , The thought is quite ingenious , Interested readers can further read in depth according to the literature mentioned in the article , thank you
- Please correct any misunderstandings
边栏推荐
- pytorch查看张量占用内存大小
- Problems in loading and saving pytorch trained models
- The network model established by torch is displayed by torch viz
- Leetcode: Jianzhi offer 03 Duplicate numbers in array
- [OC]-<UI入门>--常用控件-UIButton
- @Jsonbackreference and @jsonmanagedreference (solve infinite recursion caused by bidirectional references in objects)
- UnsupportedOperationException异常
- Computer cleaning, deleted system files
- Roguelike game into crack the hardest hit areas, how to break the bureau?
- 使用latex导出IEEE文献格式
猜你喜欢

Tcp/ip protocol

Intel Distiller工具包-量化实现1

JVM quick start

Delay initialization and sealing classes

Using pkgbuild:: find in R language_ Rtools check whether rtools is available and use sys The which function checks whether make exists, installs it if not, and binds R and rtools with the writelines

Variable length parameter

数学建模2004B题(输电问题)

Computer cleaning, deleted system files

Using C language to complete a simple calculator (function pointer array and callback function)

Detailed explanation of heap sorting
随机推荐
LeetCode:836. Rectangle overlap
软件压力测试常见流程有哪些?专业出具软件测试报告公司分享
Unsupported operation exception
Mongodb installation and basic operation
Notes 01
ESP8266-RTOS物联网开发
力扣每日一题(二)
Leetcode刷题题解2.1.1
Pytorch view tensor memory size
项目连接数据库遇到的问题及解决
【文本生成】论文合集推荐丨 斯坦福研究者引入时间控制方法 长文本生成更流畅
LeetCode:26. Remove duplicates from an ordered array
Using C language to complete a simple calculator (function pointer array and callback function)
Export IEEE document format using latex
Simclr: comparative learning in NLP
[embedded] cortex m4f DSP Library
Revit 二次开发 HOF 方式调用transaction
LeetCode:214. 最短回文串
超高效!Swagger-Yapi的秘密
The network model established by torch is displayed by torch viz