Description of the Configuration Parameters
Function |
Inference mode |
---|---|
Type |
enum |
Value Range |
USE_CPU |
Parameter |
USE_CPU: Uses the CPU for inference. |
Recommended Value |
USE_CPU |
Mandatory or Optional |
Mandatory |
Function |
Quantization mode |
---|---|
Type |
enum |
Value Range |
|
Parameter |
There are two quantization mapping formulas:
|
Recommended Value |
HALF_OFFSET |
Mandatory or Optional |
Mandatory |
Function |
Weight quantization mode |
---|---|
Type |
enum |
Value Range |
|
Parameter |
A convolution operator may have multiple filters, and the corresponding quantization parameters may be different.
|
Recommended Value |
VECTOR_TYPE |
Mandatory or Optional |
Mandatory |
Function |
Pre-processing and input parameters |
---|---|
Type |
Struct |
Value Range |
None |
Parameter |
Pre-processing and input settings. The number of preprocess_parameter parameters must be the same as the number of operators input to the network. preprocess_parameter contains the following parameters:
|
Recommended Value |
None |
Mandatory or Optional |
Mandatory |
Function |
Input data type |
---|---|
Type |
enum |
Value Range |
|
Parameter |
Input type. Currently, the image (IMAGE) and binary file (BINARY) formats are supported.
|
Recommended Value |
None |
Mandatory or Optional |
Mandatory |
File Header/Data |
Address Offset |
Type |
Value |
Description |
---|---|---|---|---|
File header (20 bytes in total) |
0000 |
32-bit int |
510 |
Magic number. When the magic number is 510, it is used to verify the validity of a file. |
0004 |
32-bit int |
50 |
Input num |
|
0008 |
32-bit int |
3 |
Input channels |
|
0012 |
32-bit int |
28 |
Input height |
|
0016 |
32-bit int |
28 |
Input width |
|
Data |
... |
float |
126 |
The number of data records is equal to the product of (num x channels x height x width). |
Function |
Input data address, that is, path of the calibration set images |
---|---|
Type |
string |
Value Range |
None |
Parameter |
Folder or file to be quantified. The path cannot contain Chinese characters, special characters (including | ; & $ > < `), or spaces. Set this parameter based on the actual network configuration.
|
Recommended Value |
Set this parameter to an image folder or a binary file as required. |
Mandatory or Optional |
Mandatory |
Function |
Order of the three channels of the image input |
---|---|
Type |
enum |
Value Range |
|
Parameter |
Order of the three channels of the image input for model training This parameter is mandatory when input_type is set to IMAGE. This parameter is determined based on the order of the input channels for network training. A typical order is BGR. |
Recommended Value |
BGR |
Mandatory or Optional |
Mandatory |
Function |
Mean value for image preprocessing |
---|---|
Type |
float |
Value Range |
[0, 255.0] |
Parameter |
Mean value of a channel for image preprocessing This parameter is mandatory when input_type is set to IMAGE. The count of mean values is determined by the channel count. Three mean values need to be configured for the RGB channels respectively as follows:
|
Recommended Value |
None |
Mandatory or Optional |
Mandatory |
Function |
Standard deviation for image preprocessing |
---|---|
Type |
float |
Value Range |
[0, FLOAT_MAX] |
Parameter |
Standard deviation for image preprocessing This parameter is mandatory when input_type is set to IMAGE. Channels share the same standard deviation. If the input range is beyond the range that can be represented by the FLOAT type, the quantization precision of the model cannot be guaranteed. If 0 ≤ standard_deviation ≤ 0.00001, the value of standard_deviation is 1.0. |
Recommended Value |
1.0: The image value range (Source image value – Mean value) does not change. 255.0: If the image value range is [0, 0,255], the value can be condensed to [0,1, 1.0]. |
Mandatory or Optional |
Mandatory |
Function |
Data range of the mapping histogram |
---|---|
Type |
uint32 |
Value Range |
[0, 1000] |
Parameter |
Data range of the histogram statistics The statistics histogram is required during the divergence computation. The value of this parameter determines the maximum value of the histogram. If this parameter is not set or set to 0, the default value 150 is used. |
Recommended Value |
100/150/200/250 |
Mandatory or Optional |
Optional |
Function |
Type of the divergence computation |
---|---|
Type |
enum |
Value Range |
|
Parameter |
Different divergence types correspond to different computation methods. The default value is KL. |
Recommended Value |
None |
Mandatory or Optional |
Optional |
Function |
Whether to use the quantized data as the inference input |
---|---|
Type |
bool |
Value Range |
|
Parameter |
Whether to use the quantized data as the inference input When this parameter is set to true, the quantization of the input data is simulated. The default value is false. |
Recommended Value |
false |
Mandatory or Optional |
Optional |
Function |
Whether to use the quantized weight as the inference input |
---|---|
Type |
bool |
Value Range |
|
Parameter |
Whether to use the quantized weight as the inference input When this parameter is set to true, the quantization and de-quantization of the weight data are simulated. The default value is true. |
Recommended Value |
true |
Mandatory or Optional |
Optional |
Function |
Search parameters |
---|---|
Type |
Struct |
Value Range |
None |
Parameter |
Search parameters super_parameter contains the following parameters:
|
Recommended Value |
None |
Mandatory or Optional |
Optional |
Function |
Searched minimum number |
---|---|
Type |
enum |
Value Range |
|
Parameter |
Indicates the minimum number to be considered as the search result among a group of numbers in ascending order. For example, if there are 100 numbers, the value 1.0 indicates that number 0 (100 – 100 x 1.0) is considered as the minimum, that is, the smallest number.
|
Recommended Value |
PERCENTILE_HIGH |
Mandatory or Optional |
Optional |
Function |
Searched maximum number |
---|---|
Type |
enum |
Value Range |
|
Parameter |
Indicates the maximum number to be considered as the search result among a group of numbers in descending order. For example, if there are 100 numbers, the value 1.0 indicates that number 0 (100 – 100 x 1.0) is considered as the maximum, that is, the largest number.
|
Recommended Value |
PERCENTILE_MID/PERCENTILE_HIGH |
Mandatory or Optional |
Optional |
Function |
Parameter |
---|---|
Type |
float |
Value Range |
end_ratio > start_ratio > 0, step_ratio > 0 (If the input range is beyond the range that can be represented by the FLOAT type, the quantization accuracy of the model cannot be guaranteed.) |
Parameter |
After d_max and d_min are found in the algorithm, the ranges taken before and after d_max and d_min are determined based on start_ratio and end_ratio. Then, the step incremented each time is determined by step_ratio. For example: If d_max is 100, start_ratio is 0.8, end_ratio is 1.2, and step_ratio is 0.01, the defined search range boundaries before and after d_max are 80 (100 x 0.8) and 120 (100 x 1.2) at a step of 1 (100 x 0.01). That is, there are 41 d_max search results in total. |
Recommended Value |
The following two sets of configurations are recommended:
|
Mandatory or Optional |
Optional |
Function |
Number of images in the quantization calibration set to be processed |
---|---|
Type |
uint32 |
Value Range |
[0, UINT32_MAX) |
Parameter |
Number of images in the quantization calibration set to be processed If this parameter is not set or set to 0, all images in the calibration set are used. If the value is greater than 0, the smaller one in the total number of images in the calibration set path and the value of this parameter is used as the actual number of images in the calibration set. It is recommended that the number of images in the calibration set do not exceed 500. |
Recommended Value |
50 |
Mandatory or Optional |
Optional |
Function |
Quantization operator blacklist |
---|---|
Type |
string |
Value Range |
Operator name |
Parameter |
Operators in the list are not used for quantization.
|
Recommended Value |
None |
Mandatory or Optional |
Optional |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot