当前位置:网站首页>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
边栏推荐
- TP-LINK 企业路由器 PPTP 配置
- Simple use of promise in uniapp
- [NVIDIA development board] FAQ (updated from time to time)
- [OC-Foundation框架]---【集合数组】
- Leetcode: Jianzhi offer 04 Search in two-dimensional array
- UML diagram memory skills
- 有效提高软件产品质量,就找第三方软件测评机构
- @Jsonbackreference and @jsonmanagedreference (solve infinite recursion caused by bidirectional references in objects)
- LeetCode:26. Remove duplicates from an ordered array
- Leetcode: Sword Finger offer 42. Somme maximale des sous - tableaux consécutifs
猜你喜欢
Compétences en mémoire des graphiques UML
Using C language to complete a simple calculator (function pointer array and callback function)
LeetCode:498. Diagonal traversal
Current situation and trend of character animation
Excellent software testers have these abilities
广州推进儿童友好城市建设,将探索学校周边200米设安全区域
Unsupported operation exception
Marathon envs project environment configuration (strengthen learning and imitate reference actions)
UnsupportedOperationException异常
甘肃旅游产品预订增四倍:“绿马”走红,甘肃博物馆周边民宿一房难求
随机推荐
BMINF的後訓練量化實現
LeetCode:39. 组合总和
Compétences en mémoire des graphiques UML
注意力机制的一种卷积替代方式
Target detection - pytorch uses mobilenet series (V1, V2, V3) to build yolov4 target detection platform
LeetCode:剑指 Offer 48. 最长不含重复字符的子字符串
Promise 在uniapp的简单使用
UML diagram memory skills
Using label template to solve the problem of malicious input by users
LeetCode:剑指 Offer 04. 二维数组中的查找
LeetCode:673. Number of longest increasing subsequences
Guangzhou will promote the construction of a child friendly city, and will explore the establishment of a safe area 200 meters around the school
Super efficient! The secret of swagger Yapi
The problem and possible causes of the robot's instantaneous return to the origin of the world coordinate during rviz simulation
ant-design的走马灯(Carousel)组件在TS(typescript)环境中调用prev以及next方法
Simclr: comparative learning in NLP
[today in history] February 13: the father of transistors was born The 20th anniversary of net; Agile software development manifesto was born
Delay initialization and sealing classes
LeetCode:394. String decoding
Intel Distiller工具包-量化实现2