Commit 0b18ac1d by Klin

doc: AlexNet_BN: add readme

parent 24acac26
# AlexNet_BN 量化说明
+ 结构和AlexNet基本一致,在训练中的每个conv后加了bn层,量化时将conv、bn、relu整合为QConvBNReLu层。
## ptq部分
+ 量化结果:
FP32-acc:87.09
![image-20230409143615651](image/image-20230409143615651.png)
+ 数据拟合:
matlab导入数据,选择列向量
+ 加入FP3-FP7前:
+ js_flops - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230409133159255](image/image-20230409133159255.png)
- [x] center and scale
![image-20230409133216797](image/image-20230409133216797.png)
+ js_param - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230409133305267](image/image-20230409133305267.png)
- [x] center and scale
![image-20230409133331030](image/image-20230409133331030.png)
+ 加入FP3-FP7后
+ js_flops - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230409133616671](image/image-20230409133616671.png)
- [x] center and scale
![image-20230409143802907](image/image-20230409143802907.png)
+ js_param - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
+ [ ] center and scale
![image-20230409143907871](image/image-20230409143907871.png)
- [x] center and scale
![image-20230409143845569](image/image-20230409143845569.png)
\ No newline at end of file
title_list:
INT_2 INT_3 INT_4 INT_5 INT_6 INT_7 INT_8 INT_9 INT_10 INT_11 INT_12 INT_13 INT_14 INT_15 INT_16 POT_2 POT_3 POT_4 POT_5 POT_6 POT_7 POT_8 FLOAT_8_E1 FLOAT_8_E2 FLOAT_8_E3 FLOAT_8_E4 FLOAT_8_E5 FLOAT_8_E6
INT_2 INT_3 INT_4 INT_5 INT_6 INT_7 INT_8 INT_9 INT_10 INT_11 INT_12 INT_13 INT_14 INT_15 INT_16 POT_2 POT_3 POT_4 POT_5 POT_6 POT_7 POT_8 FLOAT_3_E1 FLOAT_4_E1 FLOAT_4_E2 FLOAT_5_E1 FLOAT_5_E2 FLOAT_5_E3 FLOAT_6_E1 FLOAT_6_E2 FLOAT_6_E3 FLOAT_6_E4 FLOAT_7_E1 FLOAT_7_E2 FLOAT_7_E3 FLOAT_7_E4 FLOAT_7_E5 FLOAT_8_E1 FLOAT_8_E2 FLOAT_8_E3 FLOAT_8_E4 FLOAT_8_E5 FLOAT_8_E6
js_flops_list:
7387.8387083277485 2625.646435310612 589.91636808698 139.95492927297437 33.8983605658435 8.359293282998879 2.1215919013939892 0.5949189968789877 0.21308991244024103 0.11823919118283611 0.09430009417522452 0.0884034201829813 0.08698064445069444 0.08660932120612393 0.08648587605309264 7387.827280285783 1617.9747290402101 133.618121322591 131.5187706011966 131.5184636928202 131.520500920649 131.52039483173797 38.28525788546344 30.667441469498364 0.7272154694255277 2.4588822349622057 9.531602207993652 36.551019015622856
7387.838496104369 2625.646833355205 589.9163523840543 139.95492844215636 33.898346427925894 8.359296461665465 2.1216004520452856 0.5949235039400762 0.21309794043284996 0.11825646935172719 0.09429331800099429 0.08841095083362506 0.08699678964334162 0.08663305654197168 0.08647598591627721 7387.827067868839 1617.97485666175 133.61810656803314 131.5187461175448 131.5184480272645 131.52048525420298 131.520379017506 1067.9230850082097 255.60428668878217 239.45983640568826 94.13499025246169 85.9906047976941 36.80986958674102 54.05786859221271 47.867086055234125 9.63279058044633 36.55164430227947 42.24566761329685 35.471179319270334 2.5217779013551413 9.531897021062111 36.55105201198746 38.2852725131297 30.667455239210526 0.7272006067102655 2.4588845270355084 9.531607285329187 36.55102319987964
js_param_list:
7387.8387083277485 2625.646435310612 589.91636808698 139.95492927297437 33.8983605658435 8.359293282998879 2.1215919013939892 0.5949189968789877 0.21308991244024103 0.11823919118283611 0.09430009417522452 0.0884034201829813 0.08698064445069444 0.08660932120612393 0.08648587605309264 7387.827280285783 1617.9747290402101 133.618121322591 131.5187706011966 131.5184636928202 131.520500920649 131.52039483173797 38.28525788546344 30.667441469498364 0.7272154694255277 2.4588822349622057 9.531602207993652 36.551019015622856
7387.838496104369 2625.646833355205 589.9163523840543 139.95492844215636 33.898346427925894 8.359296461665465 2.1216004520452856 0.5949235039400762 0.21309794043284996 0.11825646935172719 0.09429331800099429 0.08841095083362506 0.08699678964334162 0.08663305654197168 0.08647598591627721 7387.827067868839 1617.97485666175 133.61810656803314 131.5187461175448 131.5184480272645 131.52048525420298 131.520379017506 1067.9230850082097 255.60428668878217 239.45983640568826 94.13499025246169 85.9906047976941 36.80986958674102 54.05786859221271 47.867086055234125 9.63279058044633 36.55164430227947 42.24566761329685 35.471179319270334 2.5217779013551413 9.531897021062111 36.55105201198746 38.2852725131297 30.667455239210526 0.7272006067102655 2.4588845270355084 9.531607285329187 36.55102319987964
ptq_acc_list:
10.0 19.92 48.84 81.62 85.89 86.9 87.02 87.1 87.13 87.08 87.07 87.07 87.07 87.09 87.09 10.0 18.75 39.19 40.71 43.55 41.77 41.44 81.02 85.85 86.9 74.87 41.29 36.46
10.0 19.92 48.84 81.62 85.89 86.9 87.03 87.1 87.13 87.09 87.08 87.1 87.08 87.09 87.08 10.0 18.75 39.19 40.72 43.55 41.77 41.42 16.37 58.14 70.31 75.27 81.85 82.79 79.64 84.63 86.46 79.42 81.14 85.76 86.84 78.98 37.06 81.02 85.85 86.88 74.87 41.3 36.46
acc_loss_list:
0.8851894374282434 0.7712973593570608 0.4392652123995407 0.06291618828932251 0.013892078071182479 0.0022962112514350016 0.0009184845005740333 0.0 -0.00034443168771528286 0.00022962112514346753 0.00034443168771528286 0.00034443168771528286 0.00034443168771528286 0.00011481056257165219 0.00011481056257165219 0.8851894374282434 0.7847301951779564 0.5500574052812859 0.5326061997703788 0.5 0.5204362801377727 0.5242250287026406 0.06980482204362799 0.014351320321469576 0.0022962112514350016 0.14041331802525822 0.525947187141217 0.5814006888633754
0.8851762544494202 0.771271098863245 0.43920082673096794 0.06280858881616717 0.013778849466069614 0.002181651165460991 0.0006889424733035052 -0.00011482374555047542 -0.00045929498220222804 0.0 0.0001148237455506386 -0.00011482374555047542 0.0001148237455506386 0.0 0.0001148237455506386 0.8851762544494202 0.7847054770926628 0.5500057411872775 0.5324377081180388 0.49994258812722475 0.5203812148352279 0.5244000459294982 0.8120335285337007 0.33241474336892873 0.192674245033873 0.13572166724078547 0.06016764266850395 0.049374210586749304 0.08554369043518202 0.028246641405442734 0.0072338959696866415 0.08806981283729477 0.06832012860259505 0.015271558158227101 0.0028705936387644964 0.09312205764152026 0.574463198989551 0.06969801354920206 0.014238144448272006 0.002411298656562268 0.14031461706280857 0.5257779308761052 0.5813526237225859
......@@ -15,8 +15,8 @@ def numbit_list(quant_type):
elif quant_type == 'POT':
num_bit_list = list(range(2,9))
else:
# num_bit_list = list(range(2,9))
num_bit_list = [8]
num_bit_list = list(range(2,9))
# num_bit_list = [8]
return num_bit_list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment