Method for improving precision of low-bit model

By analyzing and adjusting the histogram of each layer's feature map to determine a reasonable cutoff value, the problem of reduced accuracy and unstable training of the low-bit model during the quantification process is solved, and the accuracy of the low-bit model is significantly improved. It is suitable for 32-bit to 32-bit models. Conversion with 4bit precision.

CN118780329APending Publication Date: 2024-10-15INGENIC SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310369650.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

During the model quantization process, the accuracy decline and training instability of low-bit models have become major challenges, especially the lack of effective means in weight and activation value quantification, resulting in loss of computational efficiency and accuracy.

Method used

By introducing the global variable i in the neural network, analyze and draw the histogram of the feature map of each layer, determine the minimum and maximum values ​​to set a reasonable cutoff value (clip value), so as to reduce information loss during quantification, and according to different layers Adjust the truncation range according to the distribution characteristics to ensure the training effect of the low-bit model.

Benefits of technology

This method effectively reduces the accuracy loss of the quantized model and significantly improves the accuracy of the low-bit model. Especially for networks that are significantly different from the default values, reasonable clip values ​​can be set by analyzing statistical charts of the pre-training model before training. , to avoid the problem of poor convergence effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118780329A_ABST
    Figure CN118780329A_ABST
Patent Text Reader

Abstract

The invention provides a method for improving the precision of a low-bit model, and the method carries out the testing of actual data according to a converged full-precision model or a 8-bit model, carries out the statistics and analysis of the feature distribution condition of each layer, obtains a more reasonable clip value, reduces the precision loss caused by a subsequent quantification model, and is proved by a test that the precision of the low-bit model is improved. The method has a feasible effect on networks which are greatly different from default values, and the low-bit quantization precision can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of neural network, and in particular relates to a method for improving the accuracy of a low-bit model. Background Art

[0002] With the popularization of artificial intelligence applications on mobile phones and IoT, the computing performance and storage capacity of terminal hardware are relatively weak due to the limitations of energy consumption and device size, which brings new challenges to artificial intelligence models - the models need to be smaller, faster and stronger. Quantization is one of the important means. Therefore, quantization has become a popular research direction in academia and industry in recent years. But at the same time, model quantization has also caused huge challenges. There are two major challenges: one is the decrease in accuracy caused by information loss due to the decrease in representation accuracy; the other is that the discontinuity caused by quantization makes the training of neural networks unstable. Most of the work in academia and industry is also centered around them.

[0003] First of all, the benefits of quantification are:

[0004] Quantization is to store floating point numbers that were previously expressed in 32 bits or 64 bits in a form that takes up less memory space, such as 8 bits, 16 bits, or even 1 bit or 2 bits. The benefits of this are:

[0005] 1. Reduce the model size and reduce the model storage space requirements;

[0006] 2. Reduce memory bandwidth requirements;

[0007] 3. Accelerated computing. Modern mobile devices basically support SIMD (Single Instruction Multiple Data). Taking a 128-bit register as an example, a single instruction can simultaneously calculate four 32-bit single-precision floating points, or eight 16-bit integers, or sixteen 8-bit integers. Obviously, with the support of SIMD, the calculation rate of 8-bit integers is faster.

[0008] However, the problem faced by quantification is:

[0009] The core challenge of quantization is how to reduce the model data bit width while maintaining the accuracy of the model, that is, to make a trade-off between compression rate and accuracy loss. This leads to many interesting sub-problems, such as what is the quantization object (weight, activation, gradient), how many bits are quantized (8 bits, 4 bits, 2 bits, 1 bit), which quantization parameters are selected (such as moving rate, clipping value), whether the quantization parameters can be automatically optimized, whether different layers require different quantization parameters, how to restore accuracy after quantization or consider quantization during training, etc.

[0010] Model quantization mainly includes two parts: one is the quantization of weights, and the other is the quantization of activation values. Only by quantizing both parts at the same time can the maximum computational efficiency be achieved. Weights can be distributed as compactly as possible to reduce outliers and uneven distributions with the help of network regularization and other means, but there is still a lack of effective means for activation values.

[0011] In addition, the commonly used technical terms in the prior art are:

[0012] 1. The two-dimensional convolution layer (Conv2d) performs a cross-correlation operation on the input and the convolution kernel, and adds a scalar bias to get the output. Hereinafter referred to as Conv;

[0013] 2. Batch Normalization: For each batch of data, normalization processing (mean is 0, standard deviation is 1) is added before each layer of the network input, forcing all batches of data to be under a unified data distribution. Hereinafter referred to as BN.

[0014] 3. Activation function: The neural network learns nonlinear relationships by adding activation functions, thus having a stronger ability to extract features. Hereinafter referred to as Act.

[0015] 4. Batch: a batch of data, usually a mini_batch;

[0016] 5. Commonly used neural network layers: fully connected layer, two-dimensional convolutional layer, pooling layer, BN layer, dropout layer, flaten layer.

[0017] 6.Torch is a neural network library using the Lua language. Summary of the invention

[0018] In order to solve the above problems, the purpose of this application is to propose a method that can effectively improve the accuracy of 8 or 4-bit models.

[0019] Specifically, the present invention provides a method for improving the accuracy of a low-bit model, the method comprising the following steps:

[0020] S1, introduce a global variable i, which is used to store the histogram name later to prevent the overlap of different layers with the same name, denoted as global i;

[0021] S2, converts the feature map data of any layer except the output layer in the neural network library torch into a list, expressed as:

[0022] data=(x.view(-1).detach().cpu().numpy()).tolist(),

[0023] Among them, the feature map of the middle layer of torch is generally four dimensions, representing batch, channel, height, and width respectively. View(-1) represents expanding these four dimensions into one dimension with a length of batch*channel*height*width; detach() returns a new tensor tensor, which shares a memory with the data of the original tensor; cpu() transfers the data on the image processor gpu to the central processing unit cpu for operation; numpy() converts the torch tensor into numpy data so that it can be converted into a list list by tolist later;

[0024] S3, the value of i is increased by 1 each time, and the new value is assigned to i, which is expressed as i=i+1;

[0025] S4, the row takes 0.2% of the length of data, recorded as the minimum subscript idx_min, expressed as: idx_min = int (len (data) * 0.002);

[0026] S5, the row takes 99.8% of the length of data, recorded as the maximum subscript idx_max, expressed as: idx_max = int(len(data)*0.998);

[0027] S6, the row sorts the values ​​of data from small to large, expressed as: sorted_data = sorted(data);

[0028] S7, take out the value my_min corresponding to the minimum subscript idx_min, and retain one decimal place, expressed as: my_min = round (sorted_data [idx_min], 1);

[0029] S8, take out the value my_max corresponding to the maximum value subscript idx_max, and retain one decimal place, expressed as: my_max = round (sorted_data [idx_max], 1);

[0030] S9, print out the statistical values ​​my_min, my_max, expressed as: print("conv-->min,max:", my_min, my_max);

[0031] S10, use plt to draw a histogram for easy viewing. The plt is a tool library for drawing in Python. Before use, you need to install pip install plt, which is expressed as:

[0032] plt.hist(data,rwidth=1)

[0033] plt.savefig(". / features / conv_%s.png"%(i))

[0034] plt.close().

[0035] The length of the data in steps S4 and S5 is batch*channels*height*width. If the batch is 128, assuming the first layer is 640*640, the first layer is 128*3*640*640=157286400.

[0036] The round(x,1) in steps S7 and S8 is to round x to one decimal place.

[0037] The method is applicable to:

[0038] 1) 32-bit accuracy is normal, 8-bit accuracy is lost;

[0039] 2) 32-bit precision is normal, 8-bit precision is lossless, and 4-bit precision is lost;

[0040] This method can be used in both of the above situations.

[0041] In order to ensure the effect of low-bit training, the method uses its pre-trained model to perform a test before training and runs a batch for analysis and statistics. The pre-trained model corresponds to the above two situations: 1) 32-bit accuracy is normal, 8-bit accuracy is lost, then the pre-trained model is a 32-bit model; 2) 32-bit accuracy is normal, 8-bit accuracy is lossless, and 4-bit accuracy is lost, then the pre-trained model is an 8-bit model, and an appropriate clip value is set according to the statistical chart for analysis and statistics, that is, actual data is tested according to the converged full-precision model or 8-bit model, and the feature distribution of each layer is counted and analyzed. The clip value is analyzed and adjusted to obtain a more reasonable clip value to avoid re-analysis and training when the convergence effect is not good.

[0042] In the method, each layer is individually set according to the distribution. In order to facilitate all the same layers to be set to a uniform value, a large value is taken according to the results of the analysis.

[0043] The more reasonable clip value is that each layer takes its minimum and maximum values ​​according to the statistical value; when calculating, the values ​​corresponding to 0.2% and 99.8% of the data are taken to obtain my_min and my_max. If it is relu / relu6, the lower limit is set to 0, that is, my_min does not work. If it is other activations with negative semi-axis, including leakyrelu / prelu, then the maximum value of the absolute value of my_min and my_max is absmax=max(abs(my_min), abs(my_max)), and the positive and negative values ​​are taken as its upper and lower limits, that is, -absmax to absmax. Here, 99.8% of the value is taken to remove individual abnormal values; for convenience when using, the same value is set. Assuming that there are 5 layers of convolution, the maximum values ​​are 3.6, 3,8, 4.0, 4.2, and 4,4 respectively. In a similar range, that is, the values ​​are close to the error range within 1, the mean value of 4.0 is directly taken to set it uniformly. If the distribution of conv and add is inconsistent, the two are set separately.

[0044] The same layers include convolutional or fully connected layers.

[0045] The quantization in the method includes: quantizing the output of Conv+BN+Act into features, so the three are regarded as one layer; when quantizing, the model based on float, i.e. 32 bits, is first truncated to remove values ​​that deviate far from the boundary; if there is no BN or Act in the method, the combination is carried out in sequence, including Conv+BN or Conv+Act.

[0046] Therefore, the advantage of the present application is that the method can reduce the accuracy loss caused by the subsequent quantization model. Experiments have shown that this method has a practical effect on networks that are significantly different from the default values ​​and can greatly improve the low-bit quantization accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0048] Figure 1(1) and Figure 1(2) are schematic diagrams of the statistical graphs obtained by taking two layers as examples of the data distribution of each layer after activation (Conv+BN+Act) of each layer in a batch of 32-bit tests.

[0049] Figure 2(1) and Figure 2(2) are schematic diagrams of the statistical graphs obtained by selecting two layers when an 8-bit model is used to perform feature statistics on a small batch of data.

[0050] Figure 3 It is a flow chart of the method of the present application.

[0051] Figure 4 It is a code schematic diagram of the method of this application. DETAILED DESCRIPTION

[0052] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.

[0053] The present application relates to a method for improving the accuracy of a low-bit model. The general idea of ​​the present invention is as follows:

[0054] Prerequisites:

[0055] 1.32-bit accuracy is normal, 8-bit accuracy is lost;

[0056] 2.32-bit precision is normal, 8-bit precision is lossless, and 4-bit precision is lost.

[0057] Both of the above methods can be improved by the method mentioned in the present invention.

[0058] like Figure 3 As shown, the method comprises the following steps:

[0059] S1, introduce a global variable i, which is used to store the histogram name later to prevent the overlap of different layers with the same name, denoted as global i;

[0060] S2, converts the feature map data of any layer except the output layer in the neural network library torch into a list, expressed as:

[0061] data=(x.view(-1).detach().cpu().numpy()).tolist(),

[0062] Among them, the feature map of the middle layer of torch is generally four dimensions, representing batch, channel, height, width, and view(-1) represents expanding these four dimensions into one dimension with a length of batch*channel*height*width; detach() returns a new tensor tensor, which shares a memory with the data of the original tensor; cpu() transfers the data on the image processor gpu to the central processing unit cpu for operation; numpy() converts the torch tensor into numpy data so that it can be converted into a list list by tolist later;

[0063] S3, the value of i is increased by 1 each time, and the new value is assigned to i, which is expressed as i=i+1;

[0064] S4, the row takes 0.2% of the length of data, recorded as the minimum subscript idx_min, expressed as: idx_min = int (len (data) * 0.002);

[0065] S5, the row takes 99.8% of the length of data, recorded as the maximum subscript idx_max, expressed as: idx_max = int(len(data)*0.998);

[0066] S6, the row sorts the values ​​of data from small to large, expressed as: sorted_data = sorted(data);

[0067] S7, take out the value my_min corresponding to the minimum subscript idx_min, and retain one decimal place, expressed as: my_min = round (sorted_data [idx_min], 1);

[0068] S8, take out the value my_max corresponding to the maximum value subscript idx_max, and retain one decimal place, expressed as: my_max = round (sorted_data [idx_max], 1);

[0069] S9, print out the statistical values ​​my_min, my_max, expressed as: print("conv-->min,max:", my_min, my_max);

[0070] S10, use plt to draw a histogram for easy viewing. The plt is a tool library for drawing in Python. Before use, you need to install pip install plt, which is expressed as:

[0071] plt.hist(data,rwidth=1)

[0072] plt.savefig(". / features / conv_%s.png"%(i))

[0073] plt.close().

[0074] The length of the data in steps S4 and S5 is batch*channels*height*width. If the batch is 128, assuming the first layer is 640*640, the first layer is 128*3*640*640=157286400.

[0075] The round(x,1) in steps S7 and S8 is to round x to one decimal place.

[0076] The core code is implemented as follows Figure 4 As shown, the code specifically describes:

[0077] The first line introduces a global variable i, which is mainly used to store histogram names later to prevent overlapping of different layers with the same names.

[0078] The second line converts the feature map data of a layer in torch into a list;

[0079] The value of i in the third row is incremented by 1 each time to become a new value;

[0080] The fourth line takes 0.2% of the data length and records it as the minimum subscript idx_min (the data length is generally very large, such as 640*640 in the first layer);

[0081] The fifth line takes 99.8% of the length of data and records it as the maximum subscript idx_max;

[0082] Line 6 sorts the values ​​of data from small to large;

[0083] Line 7 takes out the value my_min corresponding to the minimum subscript idx_min and retains one decimal place (round(x,1) means rounding x to one decimal place);

[0084] Line 8 takes out the value my_max corresponding to the maximum subscript idx_max and retains one decimal place; line 9 prints out the statistical values ​​my_min, my_max;

[0085] Lines 10-12 use plt to draw a histogram for easy viewing.

[0086] This aspect mainly obtains the appropriate clip value by analyzing feature statistics. It does not involve specific quantization methods. General linear quantization can be used for quantization: Usually, the output of Conv+BN+Act is quantized as Feature, so these three are regarded as one layer (of course, if there is no BN or Act, they are combined in sequence, such as Conv+BN or Conv+Act).

[0087] During quantization, the model based on float (i.e. 32bit) will be truncated first to remove values ​​that deviate far from the boundary. The default value of clip (truncation) for 8bit quantization will be set to 6, that is, if it is ReLU or ReLU6, which only contains the positive semi-axis, it will be truncated to (0,6) before quantization; if it is an activation with a negative semi-axis, that is, when the activation is Leaky, PReLU or no activation, it will be truncated to (-6,6) before quantization. However, for some special training sets or network structures, this empirical value is not applicable. After using it, the accuracy obtained is greater than that of float. At this time, it is necessary to analyze and adjust this clip value.

[0088] In view of the above situation, it is necessary to count the data distribution of each layer after activation (Conv+BN+Act) of each layer in a batch of 32-bit tests. The statistical graphs obtained by taking two layers as examples are shown in Figure 1(1) and Figure 1(2). It can be seen that the data is basically concentrated between -2 and 2, so the default value of 6 is too large and inappropriate at this time. After modification, the accuracy can be significantly improved.

[0089] Similarly, the 4-bit model is trained based on the 8-bit pre-trained model. The default clip value is 4 (empirical value, mostly applicable), but sometimes it fails. At this time, the 8-bit model needs to be used to perform feature statistics on a small batch of data. Examples are shown in Figure 2 (1) and Figure 2 (2), where two layers are selected. It can be seen that most of the data are concentrated between -0.5 and 0.5, with a small range. Obviously, the default value of 4 is not appropriate at this time.

[0090] Therefore, in order to ensure the effect of low-bit training, the pre-trained model is used for testing before training, and a batch is analyzed and counted. The clip value is set appropriately to avoid the time cost of re-analyzing the training when the convergence effect is not good. In addition, another way to improve is to set each layer separately according to the distribution, so that the effect should be improved to a certain extent. For convenience, all the same layers (such as convolution or full connection) are set to a unified value, and the larger one is taken according to the analysis results.

[0091] The method is applicable to:

[0092] 1) 32-bit accuracy is normal, 8-bit accuracy is lost;

[0093] 2) 32-bit precision is normal, 8-bit precision is lossless, and 4-bit precision is lost;

[0094] This method can be used in both of the above situations.

[0095] In order to ensure the effect of low-bit training, the method uses its pre-trained model to perform a test before training and runs a batch for analysis and statistics. The pre-trained model corresponds to the above two situations: 1) 32-bit accuracy is normal, 8-bit accuracy is lost, then the pre-trained model is a 32-bit model; 2) 32-bit accuracy is normal, 8-bit accuracy is lossless, and 4-bit accuracy is lost, then the pre-trained model is an 8-bit model, and an appropriate clip value is set according to the statistical chart for analysis and statistics, that is, actual data is tested according to the converged full-precision model or 8-bit model, and the feature distribution of each layer is counted and analyzed. The clip value is analyzed and adjusted to obtain a more reasonable clip value to avoid re-analysis and training when the convergence effect is not good.

[0096] In the method, each layer is individually set according to the distribution. In order to facilitate all the same layers to be set to a uniform value, a large value is taken according to the results of the analysis.

[0097] The more reasonable clip value is that each layer takes its minimum and maximum values ​​according to the statistical value; when calculating, the values ​​corresponding to 0.2% and 99.8% of the data are taken to obtain my_min and my_max. If it is relu / relu6, the lower limit is set to 0, that is, my_min does not work. If it is other activations with negative semi-axis, including leakyrelu / prelu, then the maximum value of the absolute value of my_min and my_max is absmax=max(abs(my_min), abs(my_max)), and the positive and negative values ​​are taken as its upper and lower limits, that is, -absmax to absmax. Here, 99.8% of the value is taken to remove individual abnormal values; for convenience when using, the same value is set. Assuming that there are 5 layers of convolution, the maximum values ​​are 3.6, 3,8, 4.0, 4.2, and 4,4 respectively. In a similar range, that is, the values ​​are close to the error range within 1, the mean value of 4.0 is directly taken to set it uniformly. If the distribution of conv and add is inconsistent, the two are set separately.

[0098] In summary, the innovative features of the present invention are:

[0099] Based on the converged full-precision model or 8-bit model, actual data is tested, and the feature distribution of each layer is counted and analyzed to obtain a more reasonable clip value, thereby reducing the accuracy loss caused by the subsequent quantization model. Experiments have shown that this method has a practical effect on networks that are significantly different from the default values, and can greatly improve the low-bit quantization accuracy.

[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for improving the accuracy of a low-bit model, characterized in that: The method comprises the following steps: S1, introduce a global variable i, which is used to store the histogram name later to prevent the overlap of different layers with the same name, denoted as global i; S2, converts the feature map data of any layer except the output layer in the neural network library torch into a list, expressed as: data=(x.view(-1).detach().cpu().numpy()).tolist(), Among them, the feature map of the middle layer of torch is generally four dimensions, representing batch, channel, height, and width respectively. View(-1) represents expanding these four dimensions into one dimension with a length of batch*channel*height*width; detach() returns a new tensor tensor, which shares a memory with the data of the original tensor; cpu() transfers the data on the image processor gpu to the central processing unit cpu for operation; numpy() converts the torch tensor into numpy data so that it can be converted into a list list by tolist later; S3, the value of i is increased by 1 each time, and the new value is assigned to i, which is expressed as i=i+1; S4, the row takes 0.2% of the length of data, recorded as the minimum subscript idx_min, expressed as: idx_min = int (len (data) * 0.002); S5, the row takes 99.8% of the length of data, recorded as the maximum subscript idx_max, expressed as: idx_max = int(len(data)*0.998); S6, the row sorts the values ​​of data from small to large, expressed as: sorted_data = sorted(data); S7, take out the value my_min corresponding to the minimum subscript idx_min, and retain one decimal place, expressed as: my_min = round (sorted_data [idx_min], 1); S8, take out the value my_max corresponding to the maximum value subscript idx_max, and retain one decimal place, expressed as: my_max = round (sorted_data [idx_max], 1); S9, print out the statistical values ​​my_min, my_max, expressed as: print("conv-->min,max:", my_min, my_max); S10, use plt to draw a histogram for easy viewing. The plt is a tool library for drawing in Python. Before use, you need to install pip install plt, which is expressed as: plt.hist(data,rwidth=1) plt.savefig(". / features / conv_%s.png"%(i)) plt.close().

2. A method for improving the accuracy of a low-bit model according to claim 1, characterized in that: The length of the data in steps S4 and S5 is batch*channels*height*width. If the batch is 128, assuming the first layer is 640*640, the first layer is 128*3*640*640=157286400.

3. The method for improving the accuracy of a low-bit model according to claim 1, characterized in that: The round(x,1) in steps S7 and S8 is to round x to one decimal place.

4. The method for improving the accuracy of a low-bit model according to claim 1, characterized in that: The method is applicable to: 1) 32-bit accuracy is normal, 8-bit accuracy is lost; 2) 32-bit precision is normal, 8-bit precision is lossless, and 4-bit precision is lost; This method can be used in both of the above situations.

5. A method for improving the accuracy of a low-bit model according to claim 4, characterized in that: In order to ensure the effect of low-bit training, the method uses its pre-trained model to perform a test before training and runs a batch for analysis and statistics. The pre-trained model corresponds to the above two situations: 1) 32-bit accuracy is normal, 8-bit accuracy is lost, then the pre-trained model is a 32-bit model; 2) 32-bit accuracy is normal, 8-bit accuracy is lossless, and 4-bit accuracy is lost, then the pre-trained model is an 8-bit model, and an appropriate clip value is set according to the statistical chart for analysis and statistics, that is, actual data is tested according to the converged full-precision model or 8-bit model, and the feature distribution of each layer is counted and analyzed. The clip value is analyzed and adjusted to obtain a more reasonable clip value to avoid re-analysis and training when the convergence effect is not good.

6. A method for improving the accuracy of a low-bit model according to claim 5, characterized in that: In the method, each layer is individually set according to the distribution. In order to facilitate all the same layers to be set to a uniform value, a large value is taken according to the results of the analysis.

7. A method for improving the accuracy of a low-bit model according to claim 6, characterized in that: The more reasonable clip value is that each layer takes its minimum and maximum values ​​according to the statistical value; when calculating, the values ​​corresponding to 0.2% and 99.8% of the data are taken to obtain my_min and my_max. If it is relu / relu6, the lower limit is set to 0, that is, my_min does not work. If it is other activations with negative semi-axis, including leakyrelu / prelu, then the maximum value of the absolute value of my_min and my_max is absmax=max(abs(my_min), abs(my_max)), and the positive and negative values ​​are taken as its upper and lower limits, that is, -absmax to absmax. Here, 99.8% of the value is taken to remove individual abnormal values; for convenience when using, the same value is set. Assuming that there are 5 layers of convolution, the maximum values ​​are 3.6, 3,8, 4.0, 4.2, and 4,4 respectively. In a similar range, that is, the values ​​are close to the error range within 1, the mean value of 4.0 is directly taken to set it uniformly. If the distribution of conv and add is inconsistent, the two are set separately.

8. A method for improving the accuracy of a low-bit model according to claim 7, characterized in that: The same layers include convolutional or fully connected layers.

9. The method for improving the accuracy of a low-bit model according to claim 1, characterized in that: The quantization in the method includes: quantizing the output of Conv+BN+Act into features, so the three are regarded as one layer; when quantizing, the model based on float, i.e. 32 bits, is first truncated to remove values ​​that deviate far from the boundary; if there is no BN or Act in the method, the combination is carried out in sequence, including Conv+BN or Conv+Act.