Commit 11e4b3c9 by Klin

fix: add matlabscript and refit for js_param

parent 23fbfabb
......@@ -23,63 +23,10 @@
+ 量化结果:
FP32-acc:85.08
![AlexNet_table](image/AlexNet_table.png)
<img src="image/table.png" alt="table" style="zoom: 33%;" />
+ 数据拟合
+ 数据拟合:
![flops](image/flops.png)
matlab导入数据,选择列向量
+ 加入FP3-FP7前:
+ js_flops - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![fig1](image/fig1.png)
- [x] center and scale
![fig2](image/fig2.png)
+ js_param - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![fig3](image/fig3.png)
- [x] center and scale
![fig4](image/fig4.png)
+ 加入FP3-FP7后
+ js_flops - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230407010858191](image/fig5.png)
- [x] center and scale
![image-20230407011501987](image/fig6.png)
+ js_param - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230407010945342](image/fig7.png)
- [x] center and scale
![image-20230407010958875](image/fig8.png)
\ No newline at end of file
![param](image/param.png)
\ No newline at end of file
......@@ -56,7 +56,7 @@ if __name__ == "__main__":
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print(device)
train_loader = torch.utils.data.DataLoader(
datasets.CIFAR10('data', train=True, download=True,
datasets.CIFAR10('../data', train=True, download=True,
transform=transforms.Compose([
transforms.Resize((32, 32), interpolation=InterpolationMode.BICUBIC),
transforms.RandomHorizontalFlip(),
......@@ -67,7 +67,7 @@ if __name__ == "__main__":
)
test_loader = torch.utils.data.DataLoader(
datasets.CIFAR10('data', train=False, transform=transforms.Compose([
datasets.CIFAR10('../data', train=False, transform=transforms.Compose([
transforms.Resize((32, 32), interpolation=InterpolationMode.BICUBIC),
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010))
......@@ -170,7 +170,7 @@ if __name__ == "__main__":
if js < 0.:
js = 0.
js_flops = js_flops + js * flop_ratio[layer_idx]
js_param = js_param + js * flop_ratio[layer_idx]
js_param = js_param + js * par_ratio[layer_idx]
js_flops_list.append(js_flops)
js_param_list.append(js_param)
......
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:
7507.75063214733 2739.6984955933212 602.5612756622503 140.9219606122552 34.51723734934774 8.51850258417184 2.135387955471241 0.5319397685779753 0.13161209621640868 0.03248819537407536 0.008041006527013596 0.002041353551137856 0.00044022134597488164 0.0001237480336660566 2.404456269420319e-07 7507.667754908634 1654.3776843456685 136.74013174028667 134.57831309525932 134.57842088419864 134.57840070743188 134.5783010453692 33.31639395389063 32.12035410835974 0.6541864185268057 2.442042655846908 9.68812852009895 37.70545171879492
7507.750630903518 2739.696686260571 602.5610368972597 140.92196362794522 34.51723630314398 8.518501248514761 2.1353880852742875 0.5319393032307673 0.13161172461255044 0.03248745580294116 0.008041228126669929 0.002041263178018999 0.0004401365998344318 0.0001238196358571173 2.6684157208189957e-07 7507.6677482789855 1654.3776790768084 136.73977548990493 134.5782553082339 134.57822914515503 134.57815728826475 134.57822793682794 1054.343125709169 244.48315063136482 247.8970440086859 87.65672287018292 89.63829780248474 37.952907162652885 48.439500893999075 50.122513003094504 9.763710160467824 37.67667145925756 37.08251159654393 37.1627098092451 2.504499223445029 9.660234735230102 37.70545171879492 33.31639481832546 32.12035369527305 0.6541863956484224 2.4420428195112773 9.68812852009895 37.70545171879492
js_param_list:
7507.75063214733 2739.6984955933212 602.5612756622503 140.9219606122552 34.51723734934774 8.51850258417184 2.135387955471241 0.5319397685779753 0.13161209621640868 0.03248819537407536 0.008041006527013596 0.002041353551137856 0.00044022134597488164 0.0001237480336660566 2.404456269420319e-07 7507.667754908634 1654.3776843456685 136.74013174028667 134.57831309525932 134.57842088419864 134.57840070743188 134.5783010453692 33.31639395389063 32.12035410835974 0.6541864185268057 2.442042655846908 9.68812852009895 37.70545171879492
2099.4012978223045 756.8852841760424 165.48611276543275 38.661077867143234 9.465502346081184 2.3380773681828533 0.58692184552745 0.14620052066785197 0.03612237294214898 0.008920127583145731 0.002220705680193553 0.0005652568568322304 0.00012068297675722306 4.6465238698738316e-05 3.978560588757452e-06 2099.3806976929545 455.6542423459878 38.279215341990685 37.69143863173502 37.69138152272717 37.691410138985525 37.6914533221459 292.0013646264601 67.95022753681195 68.50200422208128 24.58495282264393 24.797314677833658 10.623403633392762 13.713035034152393 13.858532642027827 2.732777962743172 10.54799818234084 10.549391145072232 10.275098560105489 0.7004983113671814 2.704403793583995 10.559890009589033 9.493248004294491 8.881733731714347 0.1827908118651683 0.6834420451874454 2.716044028457789 10.559890009589033
ptq_acc_list:
10.0 10.16 51.21 77.39 83.03 84.73 84.84 85.01 85.08 85.07 85.06 85.07 85.08 85.08 85.08 10.0 14.32 72.49 72.65 72.95 72.08 72.24 82.73 83.3 85.01 84.77 59.86 51.87
10.0 10.09 56.08 77.58 83.1 84.84 84.88 85.06 85.06 85.11 85.07 85.08 85.08 85.08 85.08 10.0 13.0 71.41 73.08 72.96 72.65 73.37 24.5 66.46 51.17 77.72 77.3 82.21 81.77 81.53 84.03 81.85 81.93 82.88 84.83 84.21 51.75 82.91 83.36 85.13 84.77 59.81 51.53
acc_loss_list:
0.8824635637047484 0.8805829807240245 0.3980959097320169 0.0903855195110484 0.02409496944052653 0.004113775270333736 0.0028208744710859768 0.0008227550540666805 0.0 0.00011753643629531167 0.0002350728725904563 0.00011753643629531167 0.0 0.0 0.0 0.8824635637047484 0.8316878232251997 0.14797837329572172 0.14609779031499756 0.14257169722614005 0.152797367183827 0.150916784203103 0.027621062529384042 0.020921485660554785 0.0008227550540666805 0.0036436295251528242 0.29642689233662434 0.39033850493653033
0.8824635637047484 0.8814057357780911 0.34085566525622946 0.08815232722143865 0.02327221438645985 0.0028208744710859768 0.002350728725905064 0.0002350728725904563 0.0002350728725904563 -0.00035260930888576797 0.00011753643629531167 0.0 0.0 0.0 0.0 0.8824635637047484 0.847202632816173 0.16067230841560887 0.14104372355430184 0.1424541607898449 0.14609779031499756 0.13763516690173946 0.7120357310766338 0.2188528443817584 0.3985660554771979 0.08650681711330512 0.0914433474377057 0.03373295721673724 0.038904560413728285 0.04172543488481426 0.012341325811001377 0.03796426892336629 0.03702397743300413 0.02585801598495537 0.0029384109073812884 0.010225669957686936 0.39174894217207334 0.0255054066760696 0.02021626704278325 -0.0005876821814762242 0.0036436295251528242 0.2970145745181006 0.3943347437705689
......@@ -28,8 +28,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
......
......@@ -10,63 +10,10 @@
+ 量化结果:
FP32-acc:87.09
![AlexNet_BN_table](image/AlexNet_BN_table.png)
![image-20230410030841210](image/image-20230410030841210.png)
+ 数据拟合
+ 数据拟合:
![flops](image/flops.png)
matlab导入数据,选择列向量
+ 加入FP3-FP7前:
+ js_flops - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230410030613387](image/image-20230410030613387.png)
- [x] center and scale
![image-20230410030625395](image/image-20230410030625395.png)
+ js_param - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230410030654186](image/image-20230410030654186.png)
- [x] center and scale
![image-20230410030707277](image/image-20230410030707277.png)
+ 加入FP3-FP7后
+ js_flops - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
- [ ] center and scale
![image-20230410030018190](image/image-20230410030018190.png)
- [x] center and scale
![image-20230410030035550](image/image-20230410030035550.png)
+ js_param - acc_loss
Rational: Numerator degree 2 / Denominator degree 2
+ [ ] center and scale
![image-20230410030148120](image/image-20230410030148120.png)
+ [x] center and scale
![image-20230410030206554](image/image-20230410030206554.png)
\ No newline at end of file
![param](image/param.png)
\ No newline at end of file
......@@ -188,7 +188,7 @@ if __name__ == "__main__":
if js < 0.:
js = 0.
js_flops = js_flops + js * flop_ratio[layer_idx]
js_param = js_param + js * flop_ratio[layer_idx]
js_param = js_param + js * par_ratio[layer_idx]
js_flops_list.append(js_flops)
js_param_list.append(js_param)
......
title_list:
POT_8
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:
131.62910457064856
7398.262055529559 2629.3751622617588 590.6821895683953 140.07310170087658 33.86048167345483 8.284908066398648 2.0380663672630033 0.5092279871870147 0.12684254729585437 0.031863777467731946 0.007841108109205986 0.0019867625414859602 0.000524805638519184 0.00015510881465292402 4.128433975522605e-05 7398.228137001189 1620.2559603222214 133.7304911846874 131.62907676756663 131.62871096032845 131.6289253991913 131.62875302977494 1069.390471249252 255.89338592444176 239.72194344867773 94.18685807791533 86.02821389442595 36.77673254387978 54.05171226668418 47.849590815698406 9.560264345209177 36.522392073949895 42.22214551260318 35.435660108435656 2.4388559138472727 9.464983665314236 36.53673927235493 38.25590966717735 30.62508628497586 0.6417078348950557 2.3826050378452384 9.478115589519865 36.536710369840804
js_param_list:
131.62910457064856
2072.6257003788373 729.7410477619161 163.5885811737197 38.802816944087496 9.38263941212123 2.2969966695619557 0.5644727100537247 0.1411507960630098 0.035134381675847655 0.008839262947625631 0.0021727478905621904 0.0005508804306955368 0.00014678034905458157 4.388988379219416e-05 1.1738754839340505e-05 2072.6054855115713 448.9787413512609 37.516807535381915 36.936289293152434 36.93619699724665 36.93626107722789 36.936217327546416 297.895038404521 71.53561204104008 66.59311683208784 26.516888484693222 23.910032735846137 10.313884888190998 15.311977796193256 13.29234301305728 2.6803832302061097 10.243483526646026 11.995040344505467 9.842200480067097 0.6838675134469407 2.65413470553611 10.251089473912115 10.878179543033623 8.50328530859542 0.17976968612984542 0.66836506379984 2.6613930698773456 10.251080477543102
ptq_acc_list:
42.38
10.0 17.19 49.41 81.48 85.79 86.8 87.02 87.02 87.16 87.1 87.12 87.06 87.08 87.08 87.08 10.0 22.87 42.57 40.51 42.66 40.73 42.47 15.91 58.82 69.34 75.77 81.84 82.5 79.29 84.62 86.41 77.1 80.77 85.88 86.82 77.91 36.61 81.32 85.81 86.93 75.9 41.38 37.26
acc_loss_list:
0.5133769663566425
0.8851762544494202 0.8026179813985532 0.432655873234585 0.06441612125387529 0.014927086921575348 0.0033298886209668878 0.0008037662188541438 0.0008037662188541438 -0.0008037662188539806 -0.00011482374555047542 -0.0003444712366517526 0.0003444712366517526 0.0001148237455506386 0.0001148237455506386 0.0001148237455506386 0.8851762544494202 0.7373980939258238 0.5111953151911816 0.534849006774601 0.5101619014812264 0.5323228843724883 0.5123435526466874 0.8173154208290275 0.32460672867148926 0.20381214835227923 0.12998047996325648 0.06028246641405442 0.052704099207716196 0.08956252152945225 0.02836146515099321 0.007808014697439508 0.11470892180502938 0.07256860718796655 0.013893673211620253 0.0031002411298657736 0.10540819841543239 0.5796302675393271 0.06625330118268469 0.014697439430474234 0.0018371799288092385 0.12848777127109884 0.5248593409117005 0.5721667240785395
% 导入数据表
file_data = xlsread('D:\Desktop\ptq_result.xlsx','Sheet','B4:E46');
js_flops = file_data(:,1);
js_param = file_data(:,2);
ptq_acc = file_data(:,3);
acc_loss = file_data(:,4);
% 定义颜色向量和每个数据点所属的类别
colors = ['r', 'g', 'm'];
class = [ones(16,1); 2*ones(6,1); 3*ones(21,1)];
% 指定拟合模型
rational_model = fittype('(p1*js_flops.^2 + p2*js_flops + p3) / (q1*js_flops.^2 + q2*js_flops + q3)', 'independent', 'js_flops', 'coefficients', {'p1', 'p2', 'p3', 'q1', 'q2', 'q3'});
% 进行拟合
[fitresult,gof] = fit(js_flops, acc_loss, rational_model);
% 可视化数据点和拟合曲线
scatter(js_flops(1:15), acc_loss(1:15), [], colors(1), 'filled');
hold on;
scatter(js_flops(16:22), acc_loss(16:22), [], colors(2), 'filled');
scatter(js_flops(23:43), acc_loss(23:43), [], colors(3), 'filled');
plot(fitresult,'k',js_flops,acc_loss);
xlabel('js\_flops');
ylabel('acc\_loss');
legend('INT', 'POT', 'FLOAT','ALL', 'Rational-Fit', 'Location', 'Northeast');
% 获取评价指标
SSE=gof.sse;
R_square = gof.rsquare;
RMSE = gof.rmse;
% 将拟合公式和 R 方显示在图上
text(0.65, 0.2, sprintf('Goodness of fit:\n SSE:%.4f\n R-square:%.4f\n RMSE:%.4f', SSE, R_square, RMSE), 'Units', 'normalized', 'FontSize', 11);
hold off;
\ No newline at end of file
% 导入数据表
file_data = xlsread('D:\Desktop\ptq_result.xlsx','Sheet','B4:E46');
js_flops = file_data(:,1);
js_param = file_data(:,2);
ptq_acc = file_data(:,3);
acc_loss = file_data(:,4);
% 定义颜色向量和每个数据点所属的类别
colors = ['r', 'g', 'm'];
class = [ones(16,1); 2*ones(6,1); 3*ones(21,1)];
% 指定拟合模型
rational_model = fittype('(p1*js_flops.^2 + p2*js_flops + p3) / (q1*js_flops.^2 + q2*js_flops + q3)', 'independent', 'js_flops', 'coefficients', {'p1', 'p2', 'p3', 'q1', 'q2', 'q3'});
% 进行拟合
[fitresult,gof] = fit(js_param, acc_loss, rational_model);
% 可视化数据点和拟合曲线
scatter(js_param(1:15), acc_loss(1:15), [], colors(1), 'filled');
hold on;
scatter(js_param(16:22), acc_loss(16:22), [], colors(2), 'filled');
scatter(js_param(23:43), acc_loss(23:43), [], colors(3), 'filled');
plot(fitresult,'k',js_param,acc_loss);
xlabel('js\_param');
ylabel('acc\_loss');
legend('INT', 'POT', 'FLOAT','ALL', 'Rational-Fit', 'Location', 'Northeast');
% 获取评价指标
SSE=gof.sse;
R_square = gof.rsquare;
RMSE = gof.rmse;
% 将拟合公式和 R 方显示在图上
text(0.65, 0.2, sprintf('Goodness of fit:\n SSE:%.4f\n R-square:%.4f\n RMSE:%.4f', SSE, R_square, RMSE), 'Units', 'normalized', 'FontSize', 11);
hold off;
\ No newline at end of file
......@@ -16,7 +16,7 @@
+ 量化结果:
![image-20230415131101450](image/VGG16_table.png)
![VGG16_table](image/VGG16_table.png)
+ 拟合结果(仍采用Rational-Fit 且分子分母多项式次数均为2)
......
ykl/VGG_16/image/VGG16_table.png

24 KB | W: | H:

ykl/VGG_16/image/VGG16_table.png

21.8 KB | W: | H:

ykl/VGG_16/image/VGG16_table.png
ykl/VGG_16/image/VGG16_table.png
ykl/VGG_16/image/VGG16_table.png
ykl/VGG_16/image/VGG16_table.png
  • 2-up
  • Swipe
  • Onion skin
ykl/VGG_16/image/flops.png

38.3 KB | W: | H:

ykl/VGG_16/image/flops.png

33.7 KB | W: | H:

ykl/VGG_16/image/flops.png
ykl/VGG_16/image/flops.png
ykl/VGG_16/image/flops.png
ykl/VGG_16/image/flops.png
  • 2-up
  • Swipe
  • Onion skin
ykl/VGG_16/image/param.png

38.2 KB | W: | H:

ykl/VGG_16/image/param.png

34.2 KB | W: | H:

ykl/VGG_16/image/param.png
ykl/VGG_16/image/param.png
ykl/VGG_16/image/param.png
ykl/VGG_16/image/param.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -188,7 +188,7 @@ if __name__ == "__main__":
if js < 0.:
js = 0.
js_flops = js_flops + js * flop_ratio[layer_idx]
js_param = js_param + js * flop_ratio[layer_idx]
js_param = js_param + js * par_ratio[layer_idx]
js_flops_list.append(js_flops)
js_param_list.append(js_param)
......
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_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:
9536.47106469081 2226.0626158889118 479.08937782929337 110.29737767616203 26.512546399733633 6.543175037098545 1.6082547275660537 0.4010994730450761 0.09957296685951723 0.025111061601978204 0.006197339062824894 0.0015193397317902462 0.0003899318133136797 7.940267844549078e-05 5.244585611005781e-05 9536.459291644247 1346.1955440489223 186.04289013449343 184.66787552474796 184.66837148575442 184.66792146213083 184.66817620985174 1162.9049833811032 334.8873847416959 213.5935420790586 162.9083436672534 74.46976163903415 51.09336851340675 114.00986836720416 39.88037938309794 13.180682125861468 50.9202909583944 97.0445174571127 28.848990052727817 3.3335250261221736 13.120693891064953 50.939926759367474 90.27653845386365 24.693794509374676 0.8539888374026919 3.300766001642734 13.138977654051457 50.93992491304259
9536.471074104704 2226.062767717981 479.08937301581057 110.29737790259509 26.51254683672561 6.543175408097222 1.6082547229117354 0.4010994193665803 0.09957335073633722 0.025111075393055696 0.0061973498640195265 0.0015194423491633707 0.00038995051898299435 7.942830031237921e-05 5.2415376317010985e-05 9536.459434888866 1346.1955987678602 186.0432674146965 184.66847178581048 184.66811538285353 184.66788024897852 184.66821779056917 1162.9049832114217 334.88738457777345 213.59354200345794 162.9083436791504 74.46976130202673 51.093367953882556 114.00986841709613 39.88037886445475 13.180682344029526 50.92046138218437 97.04451701067691 28.848989954377853 3.333524419321254 13.121054175424074 50.939926759367474 90.27653874927127 24.69379491562014 0.8539878687852623 3.300629416372651 13.138977654051457 50.93992491304259
js_param_list:
9536.47106469081 2226.0626158889118 479.08937782929337 110.29737767616203 26.512546399733633 6.543175037098545 1.6082547275660537 0.4010994730450761 0.09957296685951723 0.025111061601978204 0.006197339062824894 0.0015193397317902462 0.0003899318133136797 7.940267844549078e-05 5.244585611005781e-05 9536.459291644247 1346.1955440489223 186.04289013449343 184.66787552474796 184.66837148575442 184.66792146213083 184.66817620985174 1162.9049833811032 334.8873847416959 213.5935420790586 162.9083436672534 74.46976163903415 51.09336851340675 114.00986836720416 39.88037938309794 13.180682125861468 50.9202909583944 97.0445174571127 28.848990052727817 3.3335250261221736 13.120693891064953 50.939926759367474 90.27653845386365 24.693794509374676 0.8539888374026919 3.300766001642734 13.138977654051457 50.93992491304259
6887.257101138355 1340.7850727629186 280.73809433329967 63.94496255963192 15.289535102058974 3.7565034795627565 0.9259750231943055 0.2288807692260617 0.057107940186636466 0.014183206997691562 0.003557619868239359 0.000877363417377142 0.00022626713835566516 3.542348440969017e-05 1.7145957804444833e-05 6887.256730096761 806.0595586054458 139.7164856361964 139.0401533816038 139.04027885232878 139.0402887905267 139.0402936537755 795.7370567027401 249.62616743230893 132.75014085752875 132.0024940072834 45.6707525557016 38.23747791072957 96.5944785050857 23.885526002706396 9.845974027938183 38.151876742443726 83.61522220389249 17.043439224317503 2.4726691755122503 9.815686765994785 38.15642983446397 78.20951581132825 14.518605994908436 0.6269759716394059 2.4555938958183803 9.819743080524256 38.156425344733975
ptq_acc_list:
10.0 12.67 51.93 86.38 88.89 89.24 89.57 89.51 89.54 89.46 89.43 89.42 89.43 89.44 89.44 10.0 19.8 68.72 63.57 64.2 68.3 64.97 14.62 64.76 80.17 78.59 87.49 86.76 82.86 88.38 88.85 75.46 84.16 88.8 89.27 69.36 10.25 84.8 88.95 89.4 65.43 10.38 10.32
10.0 11.77 60.12 86.44 88.81 89.35 89.3 89.5 89.51 89.44 89.46 89.43 89.43 89.44 89.44 10.0 17.19 66.85 66.15 66.9 65.02 65.06 14.46 64.07 78.19 78.84 87.19 86.74 83.16 88.48 88.84 75.33 83.87 88.84 89.36 67.65 10.23 84.71 88.79 89.43 65.56 10.35 10.19
acc_loss_list:
0.8881932021466905 0.8583407871198568 0.41938729874776387 0.034212880143112724 0.00614937388193199 0.0022361359570662216 -0.0014534883720929725 -0.000782647584973249 -0.0011180679785331902 -0.00022361359570657448 0.0001118067978532078 0.00022361359570657448 0.0001118067978532078 0.0 0.0 0.8881932021466905 0.7786225402504473 0.23166368515205724 0.2892441860465116 0.28220035778175306 0.23635957066189625 0.2735912343470483 0.8365384615384615 0.27593917710196775 0.10364490161001785 0.12131037567084073 0.02180232558139538 0.02996422182468686 0.07356887298747762 0.01185152057245083 0.006596601073345297 0.1563059033989267 0.05903398926654742 0.007155635062611813 0.0019007155635062804 0.22450805008944544 0.8853980322003577 0.051878354203935606 0.005478533094812108 0.00044722719141314897 0.26844812164579596 0.8839445438282648 0.8846153846153847
0.8881932021466905 0.8684033989266547 0.3278175313059034 0.03354203935599284 0.007043828264758446 0.0010062611806798236 0.001565295169946339 -0.0006708407871198823 -0.000782647584973249 0.0 -0.00022361359570657448 0.0001118067978532078 0.0001118067978532078 0.0 0.0 0.8881932021466905 0.807804114490161 0.25257155635062617 0.2603980322003577 0.2520125223613595 0.2730322003577818 0.2725849731663685 0.8383273703041144 0.2836538461538462 0.12578264758497318 0.118515205724508 0.025156529516994635 0.03018783542039359 0.07021466905187837 0.01073345259391764 0.006708407871198505 0.15775939177101966 0.0622763864042933 0.006708407871198505 0.0008944543828264568 0.24362701252236127 0.8856216457960644 0.05288461538461543 0.007267441860465021 0.0001118067978532078 0.266994633273703 0.8842799642218248 0.8860688729874776
......@@ -8,7 +8,7 @@
+ 量化结果
![image-20230415132704998](image/VGG19_table.png)
![VGG19_table](image/VGG19_table.png)
+ 拟合结果
......
ykl/VGG_19/image/VGG19_table.png

19.3 KB | W: | H:

ykl/VGG_19/image/VGG19_table.png

22 KB | W: | H:

ykl/VGG_19/image/VGG19_table.png
ykl/VGG_19/image/VGG19_table.png
ykl/VGG_19/image/VGG19_table.png
ykl/VGG_19/image/VGG19_table.png
  • 2-up
  • Swipe
  • Onion skin
ykl/VGG_19/image/flops.png

32.8 KB | W: | H:

ykl/VGG_19/image/flops.png

35.9 KB | W: | H:

ykl/VGG_19/image/flops.png
ykl/VGG_19/image/flops.png
ykl/VGG_19/image/flops.png
ykl/VGG_19/image/flops.png
  • 2-up
  • Swipe
  • Onion skin
ykl/VGG_19/image/param.png

32.8 KB | W: | H:

ykl/VGG_19/image/param.png

37.6 KB | W: | H:

ykl/VGG_19/image/param.png
ykl/VGG_19/image/param.png
ykl/VGG_19/image/param.png
ykl/VGG_19/image/param.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -117,6 +117,7 @@ if __name__ == "__main__":
gol._init()
quant_type_list = ['INT','POT','FLOAT']
# quant_type_list = ['FLOAT']
title_list = []
js_flops_list = []
js_param_list = []
......@@ -188,7 +189,7 @@ if __name__ == "__main__":
if js < 0.:
js = 0.
js_flops = js_flops + js * flop_ratio[layer_idx]
js_param = js_param + js * flop_ratio[layer_idx]
js_param = js_param + js * par_ratio[layer_idx]
js_flops_list.append(js_flops)
js_param_list.append(js_param)
......
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_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:
10125.068753278441 2125.8746406732002 448.16842882616936 102.722270627284 24.664131971463988 6.028952298047002 1.480885231764123 0.3654118682297422 0.09188685026974831 0.022861955175454297 0.0056817018373599695 0.0014282899203300254 0.0003389232698071482 0.00010617853089969107 3.493483722190392e-05 10125.05842558445 1275.5849171285142 202.11000563785234 200.95521018550525 200.95533928139716 200.95570148700347 200.95545858339625 1204.7518158597543 367.27809546334674 207.5115420225552 188.4010740524998 71.7702690201597 55.97867545957229 135.41876706982143 37.94656896957748 14.343459354637504 55.840083188361184 116.40261377054755 27.25354105300921 3.6060440027863243 14.295083000520314 55.85538279966775 108.58905210346933 23.270040495614047 0.9179187100968745 3.580000955703707 14.308950799466206 55.85538134242835
10125.068777303843 2125.8746059892997 448.1684269275655 102.72227108791047 24.664131592897466 6.028952690039004 1.4808848911979104 0.3654121554844982 0.09188678563921866 0.022862010935799246 0.005681738921256071 0.0014282347355091774 0.0003390110858486199 0.00010615918609977952 3.489823651098289e-05 10125.058309270402 1275.5847525159818 202.11004564591005 200.95585017589545 200.95539368760936 200.95529631550048 200.95542079271524 1204.751815912724 367.27809530828097 207.51154219067092 188.4010741493603 71.77026853544704 55.978675489218205 135.4187671720789 37.94656880869658 14.343459472762477 55.84021870450606 116.4026136353036 27.25354110333402 3.606044260373801 14.295147200396164 55.85538278221231 108.58905223595819 23.270040334049046 0.9179187347666412 3.5799479606638203 14.308950780559794 55.85538134242835
js_param_list:
10125.068753278441 2125.8746406732002 448.16842882616936 102.722270627284 24.664131971463988 6.028952298047002 1.480885231764123 0.3654118682297422 0.09188685026974831 0.022861955175454297 0.0056817018373599695 0.0014282899203300254 0.0003389232698071482 0.00010617853089969107 3.493483722190392e-05 10125.05842558445 1275.5849171285142 202.11000563785234 200.95521018550525 200.95533928139716 200.95570148700347 200.95545858339625 1204.7518158597543 367.27809546334674 207.5115420225552 188.4010740524998 71.7702690201597 55.97867545957229 135.41876706982143 37.94656896957748 14.343459354637504 55.840083188361184 116.40261377054755 27.25354105300921 3.6060440027863243 14.295083000520314 55.85538279966775 108.58905210346933 23.270040495614047 0.9179187100968745 3.580000955703707 14.308950799466206 55.85538134242835
7919.9999946725075 1368.1564225363845 283.16934566896754 64.2942694436596 15.321270118010474 3.745277689238688 0.9178676871947216 0.22807088096042888 0.056904570420633724 0.014193230067183694 0.0035684240604433215 0.0008905876260726569 0.0002163833713661727 7.152718652977152e-05 3.2130914002021176e-05 7920.002545364124 818.8838272570443 164.4618730779971 163.84526969797696 163.84537575503464 163.84534091325256 163.84535644152615 912.7525366351027 304.20939173305254 138.97594773808592 167.73729464269246 46.84141581944599 45.95750081299213 124.95158148181119 23.98366626289621 11.613224296186155 45.88300992073913 108.73234446521248 16.892437923675633 2.904718790614561 11.58708466778401 45.88710644854956 101.79740772746169 14.310069748579027 0.7348164303199256 2.8903894156159375 11.59069207978545 45.887101821422974
ptq_acc_list:
10.0 11.92 51.46 86.95 89.09 89.19 89.24 89.36 89.26 89.29 89.26 89.26 89.25 89.25 89.25 10.0 17.52 65.19 66.51 66.7 65.97 68.61 12.15 58.19 80.31 79.1 87.07 86.3 82.96 88.53 88.68 74.65 84.34 88.82 89.27 65.12 10.0 84.66 88.8 89.31 61.04 10.0 10.0
10.0 12.8 62.98 87.16 89.05 89.19 89.23 89.21 89.26 89.28 89.26 89.26 89.25 89.25 89.25 10.0 17.81 67.69 68.82 65.58 65.75 66.39 12.63 57.06 79.98 79.55 87.25 85.88 83.01 88.34 88.74 74.07 84.41 88.6 89.41 63.55 10.0 84.55 88.99 89.33 61.4 10.0 10.0
acc_loss_list:
0.8879551820728291 0.8664425770308123 0.42341736694677873 0.025770308123249267 0.0017927170868346958 0.0006722689075630507 0.00011204481792722819 -0.0012324929971988731 -0.00011204481792722819 -0.0004481792717087535 -0.00011204481792722819 -0.00011204481792722819 0.0 0.0 0.0 0.8879551820728291 0.8036974789915967 0.26957983193277313 0.2547899159663865 0.2526610644257703 0.2608403361344538 0.23126050420168068 0.8638655462184873 0.34801120448179274 0.10016806722689073 0.1137254901960785 0.024425770308123325 0.03305322128851544 0.07047619047619054 0.00806722689075629 0.006386554621848663 0.16358543417366941 0.05501400560224086 0.004817927170868424 -0.00022408963585429716 0.2703641456582633 0.8879551820728291 0.05142857142857147 0.005042016806722721 -0.0006722689075630507 0.31607843137254904 0.8879551820728291 0.8879551820728291
0.8879551820728291 0.8565826330532214 0.2943417366946779 0.02341736694677875 0.0022408963585434493 0.0006722689075630507 0.00022408963585429716 0.0004481792717087535 -0.00011204481792722819 -0.00033613445378152535 -0.00011204481792722819 -0.00011204481792722819 0.0 0.0 0.0 0.8879551820728291 0.8004481792717086 0.24156862745098043 0.22890756302521015 0.26521008403361346 0.26330532212885155 0.2561344537815126 0.8584873949579832 0.360672268907563 0.10386554621848736 0.10868347338935577 0.022408963585434174 0.03775910364145663 0.06991596638655456 0.010196078431372511 0.0057142857142857715 0.17008403361344546 0.05422969187675074 0.00728291316526617 -0.0017927170868346958 0.28795518207282916 0.8879551820728291 0.05266106442577034 0.0029131652661065 -0.0008963585434173479 0.31204481792717087 0.8879551820728291 0.8879551820728291
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