A neural network quantization deployment method, system, device and medium
By decomposing and quantizing the Long Short-Term Memory (LSTM) network layers, a quantization parameter sequence is generated, which solves the problem that general neural network accelerators cannot support LSTM computation, improves the operating efficiency and accuracy of neural networks, and is suitable for embedded systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2026-03-31
AI Technical Summary
In existing methods for deploying neural network quantization, general-purpose neural network accelerators cannot directly support the quantization computation of long short-term memory networks, resulting in the consumption of a large amount of storage space and a reduction in the efficiency of neural network quantization.
By acquiring a dataset of insulator defects in transmission lines, an initial neural network model is generated. The long short-term memory network layer is then decomposed into an intermediate neural network model. Quantization calibration is performed using a quantization parameter sequence and the intermediate neural network model to generate a quantization parameter sequence, and finally, the target neural network model is determined.
It improves the efficiency and accuracy of neural networks, is applicable to various types of invasive systems and neural network models, and reduces storage space usage.
Smart Images

Figure CN116502672B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of neural network technology, and in particular to methods, systems, devices and media for the quantitative deployment of neural networks. Background Technology
[0002] To achieve high-speed, low-power computation, embedded neural network accelerators typically only support low-precision numerical operations. Therefore, quantization algorithms are needed to compress the original network by reducing the number of precision bits required to represent weights or activations.
[0003] Currently, the primary acceleration targets of neural network accelerators on embedded FPGA (Field Programmable Gate Array) platforms are mature neural network operators such as convolution, fully connected layers, and pooling. However, as deep learning technology addresses increasingly complex problems, new and complex operators have emerged, mainly represented by variant models of RNN (Recurrent Neural Network), such as LSTM (Long Short-Term Memory) and GRU (Gate Recurrent Unit). These have been widely applied in text classification, video recognition, speech recognition, and various time series data predictions, such as pedestrian trajectory prediction, stock prediction, and rainfall prediction.
[0004] Long Short-Term Memory (LSTM) networks in neural networks involve high-density computation and complex control flow, making their hardware interfaces overly dependent on the characteristics of the neural network model and hardware platform. Existing general-purpose neural network accelerators used in neural network quantization deployment methods cannot directly support LSTM quantization computations, requiring quantization tools to support LSTM computations, which consumes significant storage space and results in low quantization efficiency for neural networks. Summary of the Invention
[0005] This invention provides a method, system, device, and medium for quantizing and deploying neural networks, which solves the technical problem that the general-purpose neural network accelerators used in existing neural network quantization deployment methods cannot directly support the quantization calculation of long short-term memory networks, require quantization tools to support LSTM calculations, occupy a lot of storage space, and result in low efficiency of neural network quantization.
[0006] This invention provides a method for quantizing and deploying neural networks, comprising:
[0007] Obtain a dataset of insulator defects in transmission lines, and use the dataset to configure a preset neural network model to generate an initial neural network model;
[0008] The long short-term memory network layer in the initial neural network model is decomposed to generate an intermediate neural network model;
[0009] The intermediate neural network model and the transmission line insulator defect dataset are used for quantization calibration to generate a quantization parameter sequence;
[0010] The target neural network model is determined by using the quantized parameter sequence and the intermediate neural network model for classification prediction.
[0011] Optionally, the step of obtaining a transmission line insulator defect dataset, using the transmission line insulator defect dataset to configure a preset neural network model, and generating an initial neural network model includes:
[0012] Obtain a dataset of insulator defects in transmission lines, and select a test dataset from a preset video classification dataset according to the dataset of insulator defects in transmission lines;
[0013] The test dataset is used to perform quantization settings and construct an initial quantization calibration set;
[0014] The initial quantization calibration set is used to update the preset neural network model to generate the initial neural network model.
[0015] Optionally, the step of decomposing the long short-term memory network layer in the initial neural network model to generate an intermediate neural network model includes:
[0016] The long short-term memory network layer in the initial neural network model is decomposed to generate a long short-term memory network layer set corresponding to the initial long short-term memory network.
[0017] The Long Short-Term Memory (LSTM) network layer set includes a first fully connected layer, a second fully connected layer, a first additive layer, a first non-linear layer, a first element-wise multiplication layer, a second element-wise multiplication layer, a second additive layer, a second non-linear layer, and a third element-wise multiplication layer connected in sequence.
[0018] The initial neural network model is updated using the set of long short-term memory network layers to generate an intermediate neural network model.
[0019] Optionally, the intermediate neural network model includes a normal layer and the long short-term memory network layer set; the step of using the intermediate neural network model and the transmission line insulator defect dataset for quantization calibration to generate a quantization parameter sequence includes:
[0020] Based on the time step corresponding to the intermediate neural network model, time series image groups and different image groups are constructed using the transmission line insulator defect dataset.
[0021] A target quantization calibration set is constructed by using the different image groups and the time series image groups for quantization settings.
[0022] The target quantization calibration set is used to quantize and calibrate the transmission line insulator defect dataset, generating multiple data sets;
[0023] The target quantization calibration set is input into the normal layer for quantization, generating a normal layer tensor sequence and quantization step size;
[0024] Determine whether the quantization step size is less than the time step size;
[0025] If so, all the data sets are input into the Long Short-Term Memory network layer set for tensor computation to generate a quantization parameter sequence;
[0026] If not, then the normal layer tensor sequence is used as the quantization parameter sequence.
[0027] Optionally, the step of inputting all the data sets into the Long Short-Term Memory network layer set for tensor computation to generate a quantization parameter sequence includes:
[0028] Input all of the data sets into the first fully connected layer to generate the initial quantization calibration dataset;
[0029] Determine whether the continuity identifier corresponding to the initial quantization calibration dataset is in a preset state;
[0030] If so, then the initial quantization calibration dataset is used to perform point addition and nonlinear calculation through the second fully connected layer, the first added layer and the first nonlinear layer to generate an intermediate initial quantization calibration dataset;
[0031] If not, then point addition and nonlinear calculation are performed using the initial quantization calibration dataset through the first added layer and the first nonlinear layer to generate an intermediate quantization calibration dataset;
[0032] Determine whether the continuity identifier corresponding to the intermediate quantization calibration dataset is in the preset state;
[0033] If so, the target quantization calibration dataset is generated by performing dot product, dot addition, and nonlinear calculations on the intermediate quantization calibration dataset through the first element-wise multiplication layer, the second element-wise multiplication layer, the second added layer, the second nonlinear layer, and the third element-wise multiplication layer.
[0034] If not, the target quantization calibration dataset is generated by performing nonlinear calculations and dot product calculations on the intermediate quantization calibration dataset through the second nonlinear layer and the third element-wise product layer.
[0035] A quantization parameter sequence is constructed using all tensor sequences corresponding to the target quantization calibration dataset.
[0036] Optionally, the step of using the quantized parameter sequence and the intermediate neural network model to perform classification prediction and determine the target neural network model includes:
[0037] The floating-point data corresponding to each layer of the intermediate neural network model is determined by using the quantization parameter sequence to perform range prediction according to a preset range threshold.
[0038] The floating-point data is mapped to low-precision data using a neural network accelerator;
[0039] The low-precision data is normalized to generate an effective real number space;
[0040] The classification accuracy is evaluated based on the intermediate neural network model and the effective real number space to determine the target neural network.
[0041] Optionally, the step of evaluating classification accuracy based on the intermediate neural network model and the effective real number space to determine the target neural network includes:
[0042] The relative entropy is calculated by using the intermediate neural network model to generate the relative entropy of the transmission line insulator defect dataset.
[0043] The maximum value is calculated by using the intermediate neural network model to generate the maximum value of the transmission line insulator defect dataset;
[0044] The maximum average value is calculated by using the intermediate neural network model to generate the maximum average value of the transmission line insulator defect dataset;
[0045] The relative entropy, the maximum value, and the maximum average value are respectively compared with the values corresponding to the effective real number space to perform classification accuracy evaluation, and accuracy evaluation data is generated.
[0046] The intermediate neural network model is updated using the accuracy evaluation data to generate the target neural network model.
[0047] The present invention also provides a neural network quantization deployment system, comprising:
[0048] The initial neural network model generation module is used to obtain a dataset of insulator defects in transmission lines, and to configure the preset neural network model using the dataset of insulator defects in transmission lines to generate an initial neural network model.
[0049] The intermediate neural network model generation module is used to decompose the long short-term memory network layer in the initial neural network model to generate an intermediate neural network model.
[0050] The quantization parameter sequence generation module is used to perform quantization calibration using the intermediate neural network model and the transmission line insulator defect dataset to generate a quantization parameter sequence.
[0051] The target neural network model determination module is used to perform hardware simulation calculations using the quantized parameter sequence and the intermediate neural network model to determine the target neural network model.
[0052] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs steps to implement any of the above-described neural network quantization deployment methods.
[0053] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements any of the neural network quantization deployment methods described above.
[0054] As can be seen from the above technical solutions, the present invention has the following advantages:
[0055] This invention acquires a dataset of insulator defects in transmission lines and uses this dataset to configure a pre-defined neural network model, generating an initial neural network model. The long short-term memory (LSTM) network layer in the initial neural network model is decomposed to generate an intermediate neural network model. Quantization calibration is performed using the intermediate neural network model and the transmission line insulator defect dataset to generate a quantization parameter sequence. Classification prediction is then performed using the quantization parameter sequence and the intermediate neural network model to determine the target neural network model. This invention solves the technical problem in existing neural network quantization deployment methods where general-purpose neural network accelerators cannot directly support LSTM network quantization calculations, requiring quantization tools to support LSTM calculations, consuming significant storage space, and resulting in low neural network quantization efficiency. The LSTM layer is converted into an existing operator for single-layer quantization and deployed on an embedded neural network model, improving the model's operating efficiency and accuracy, and making it suitable for various types of invasive systems and neural network models. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a flowchart of the steps of the neural network quantization deployment method provided in Embodiment 1 of the present invention;
[0058] Figure 2 This is a flowchart illustrating the steps of the neural network quantization deployment method provided in Embodiment 2 of the present invention.
[0059] Figure 3 This is a flowchart of the quantization calibration process for the intermediate neural network model provided in Embodiment 2 of the present invention;
[0060] Figure 4 This is a structural block diagram of the neural network quantization deployment system provided in Embodiment 3 of the present invention. Detailed Implementation
[0061] This invention provides a method, system, device, and medium for deploying neural networks using quantization. It addresses the technical problem that existing methods for deploying neural networks using general-purpose neural network accelerators cannot directly support quantization computation of Long Short-Term Memory (LSTM) networks, requiring quantization tools to support LSTM computation, which consumes a lot of storage space and results in low efficiency of neural network quantization.
[0062] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0063] Please see Figure 1 , Figure 1 The flowchart illustrates the steps of the neural network quantization deployment method provided in Embodiment 1 of the present invention.
[0064] Example 1 of this invention provides a method for deploying neural network quantization, comprising:
[0065] Step 101: Obtain the transmission line insulator defect dataset, and use the transmission line insulator defect dataset to configure the preset neural network model to generate the initial neural network model.
[0066] The transmission line insulator defect dataset includes image data and defect types corresponding to transmission line insulator defects.
[0067] The pre-defined neural network model refers to an embedded neural network model that includes a rule layer and a long short-term memory network layer.
[0068] In this embodiment of the invention, a dataset of transmission line insulator defects is obtained, and a test dataset is selected from a preset video classification dataset according to the dataset. Quantization settings are performed using the test dataset to construct an initial quantization calibration set. The preset neural network model is then updated using the initial quantization calibration set to generate an initial neural network model.
[0069] Step 102: Decompose the long short-term memory network layer in the initial neural network model to generate an intermediate neural network model.
[0070] In this embodiment of the invention, the Long Short-Term Memory (LSTM) network layers in the initial neural network model are decomposed to generate a set of LTM network layers corresponding to the initial LTM network. The LTM network layer set includes a first fully connected layer, a second fully connected layer, a first additive layer, a first non-linear layer, a first element-wise multiplication layer, a second element-wise multiplication layer, a second additive layer, a second non-linear layer, and a third element-wise multiplication layer, connected sequentially. The initial neural network model is updated using this LTM network layer set to generate an intermediate neural network model.
[0071] Step 103: Use the intermediate neural network model and the transmission line insulator defect dataset for quantitative calibration to generate a quantitative parameter sequence.
[0072] In this embodiment of the invention, the intermediate neural network model includes a normal layer and a set of long short-term memory (LSTM) network layers. Based on the time step corresponding to the intermediate neural network model, time-series image groups and different image groups are constructed using a transmission line insulator defect dataset. Quantization settings are applied to the different image groups and the time-series image groups to construct a target quantization calibration set. The transmission line insulator defect dataset is quantized and calibrated using the target quantization calibration set, generating multiple data groups. The target quantization calibration set is input into the normal layer for quantization, generating a first tensor sequence and a quantization step size. It is determined whether the quantization step size is less than the time step size. If so, all data groups are input into the LTM network layer set for tensor calculation to generate a quantization parameter sequence. If not, the normal layer tensor sequence is used as the quantization parameter sequence.
[0073] Step 104: Use the quantized parameter sequence and intermediate neural network model to perform classification prediction and determine the target neural network model.
[0074] In this embodiment of the invention, a range prediction is performed using a quantized parameter sequence according to a preset range threshold to determine the floating-point data corresponding to each layer of the intermediate neural network model. The floating-point data is mapped to low-precision data using a neural network accelerator, and the low-precision data is normalized to generate an effective real number space. Based on the intermediate neural network model and the effective real number space, classification accuracy is evaluated to determine the target neural network.
[0075] In this embodiment of the invention, a dataset of transmission line insulator defects is acquired, and a preset neural network model is configured using this dataset to generate an initial neural network model. The long short-term memory (LSTM) network layer in the initial neural network model is decomposed to generate an intermediate neural network model. Quantization calibration is performed using the intermediate neural network model and the transmission line insulator defect dataset to generate a quantization parameter sequence. Classification prediction is then performed using the quantization parameter sequence and the intermediate neural network model to determine the target neural network model. This solves the technical problem in existing neural network quantization deployment methods where general-purpose neural network accelerators cannot directly support LSTM network quantization calculations, requiring quantization tools to support LSTM calculations, consuming significant storage space, and resulting in low neural network quantization efficiency. The LSTM layer is converted into an existing operator for single-layer quantization and deployed on an embedded neural network model, improving the model's operating efficiency and accuracy, and making it suitable for various types of invasive systems and neural network models.
[0076] Please see Figure 2 , Figure 2 The flowchart illustrates the steps of the neural network quantization deployment method provided in Embodiment 2 of the present invention.
[0077] Another neural network quantization deployment method provided in Example 2 of this invention includes:
[0078] Step 201: Obtain the transmission line insulator defect dataset, and select the test dataset from the preset video classification dataset according to the transmission line insulator defect dataset.
[0079] In this embodiment of the invention, the preset video classification dataset refers to the UCF101 video action recognition classification dataset. First, a transmission line insulator defect dataset is obtained. Then, the UCF101 video action recognition classification dataset is used to evaluate the model. Based on the data type of the transmission line insulator defect dataset, 2083 video samples from the first 55 classes are selected as the test dataset on the PC and FPGA.
[0080] Step 202: Use the test dataset to perform quantization settings and construct the initial quantization calibration set.
[0081] In this embodiment of the invention, a test dataset is used for quantization settings, namely, the number of quantization calibration sets is 50*5 images; the quantization bit width is 8 bits for weight and 8 bits for activation; the number of test datasets is 2083*5 images; and the accuracy calculation standard is the first 1%. The test dataset is then quantized to generate an initial quantization calibration set.
[0082] Step 203: Update the preset neural network model using the initial quantization calibration set to generate the initial neural network model.
[0083] In this embodiment of the invention, an initial quantization calibration set obtained by quantizing a transmission line insulator defect dataset is used to update a preset neural network model, thereby obtaining an initial neural network model. The initial neural network model is configured on both a PC and an FPGA. On the PC, the model is based on the PyTorch deep learning framework, specifically the Caffe framework. On the FPGA, a conventional hierarchical quantization deployment is performed on the hardware platform. The FPGA is an embedded device, and a single-layer RNN with 256 gated recurrent unit (GRU) neurons is trained. Neurons are only updated to output when their activation changes exceed a certain threshold. An RNN model with a 256-neuron GRU layer was tested on the initial quantization calibration set. By setting a certain number of initial quantization calibration sets for the hardware platform, the convolution calculation of transmission line insulator defect data is accelerated.
[0084] Step 204: Decompose the long short-term memory network layer in the initial neural network model to generate an intermediate neural network model.
[0085] Further, step 204 may include the following sub-steps S11-S12:
[0086] S11. Decompose the long short-term memory network layer in the initial neural network model to generate the long short-term memory network layer set corresponding to the initial long short-term memory network.
[0087] The Long Short-Term Memory (LSTM) network layer set consists of a first fully connected layer, a second fully connected layer, a first additive layer, a first non-linear layer, a first element-wise multiplication layer, a second element-wise multiplication layer, a second additive layer, a second non-linear layer, and a third element-wise multiplication layer, connected in sequence.
[0088] S12. The initial neural network model is updated using a set of long short-term memory network layers to generate an intermediate neural network model.
[0089] In this embodiment of the invention, the LSTM layer for detecting defects in transmission line insulators is a specific network layer in a neural network model. The input of the LSTM layer is x and Cont, and the output is h. The tensor of x is (T, I), where T is the time step and I is the input feature dimension. Cont is a continuity identifier. The tensor of h is (T, O), where O is the output feature dimension. In the specific Caffe implementation, i.e., in the specific convolutional neural network framework implementation, the input of the LSTM can be represented as W. h *h+W x *x+b can be used to compute a deep neural network for detecting defects in transmission line insulators using two fully connected layers, instead of matrix multiplication in the following formula.
[0090] i t =sigmoid(W hi *h t-1 +W xi *x t +b i );
[0091] f t =sigmoid(W hf *h t-1 +W xf *x t +b f );
[0092] o t =sigmoid(W ho *h t-1 +W xo *x t +b o );
[0093] g t =tanh(W hg *h t-1 +W xg *x t +b g );
[0094] c t =(f t *c t-1 )+(i*g t );
[0095] h t =o t *tanh(c t );
[0096] The first fully connected layer is W x *x+b, the second fully connected layer is W h *h.
[0097] Among them, W x =[W xi W xf W xo W xg ];W h =[W hi W hf W ho W hg ];b=[b i b f b o b g ]. Among them, W hi Whf W ho W hg W is the weight matrix of the hidden states; xi W xf W xo W xg This is the weight matrix of the input nodes; b i b f b o b g It is a bias term.
[0098] In the above formula, x t Indicates the input state of the current node; h t-1 Represents the hidden state of the previous node; i is the input gate; f is the first forget gate; g is the second forget gate; o is the output gate; c t The information to be processed at time t; c t-1 It is the unit's output status at the last moment; h t It is the hidden state passed to the next node.
[0099] Based on the different layer types of the initial neural network model for insulator defect detection in transmission lines, the above formula is divided into LSTM layer operation processes, which involves decomposing the Long Short-Term Memory (LSTM) network layers in the initial neural network model to generate the LSTM network layer set corresponding to the initial LSTM network, calculated in the following 9-layer order:
[0100] The first layer, the FC layer, is the first fully connected layer: data_fc1 = W x *x t +b;
[0101] The second layer, the FC layer, is the second fully connected layer: data_fc2 = W h *h t ;
[0102] The third layer, Eltwise adds layers, which is the first added layer: data_sum = data_fc1 + data_fc2;
[0103] The fourth layer, the nonlinear layer, is the first nonlinear layer:
[0104] data_it=sigmoid(data_sum[0:O]);
[0105] data_ft=sigmoid(data_sum[O:2*O]);
[0106] data_ot=sigmoid(data_sum[2*O:3*O]);
[0107] data_gt=tanh(data_sum[3*O:4*O]);
[0108] The fifth layer, the Eltwise Prod layer, is the first element-wise product layer: eltwise1 = data_it × data_gt;
[0109] The sixth layer, the Eltwise Prod layer, is the second element-wise product layer: eltwise2 = data_ft × data_ct;
[0110] The seventh layer, the second layer added via Eltwise: data_ct = eltwise1 + eltwise2;
[0111] The eighth layer, the nonlinear layer, is the second nonlinear layer: data_ct_tanh = tanh(data_ct);
[0112] The ninth layer, the Eltwise Prod layer, is the third element-wise product layer:
[0113] data_ht=data_ot×data_ct_tanh.
[0114] Where, x t Indicates the input state of the current node; h t-1 Represents the hidden state of the previous node; i is the input gate; f is the first forget gate; g is the second forget gate; o is the output gate; c t The information to be processed at time t; t is time; c t-1 It is the unit's output status at the last moment; h t O is the hidden state passed to the next node; O is the output feature dimension.
[0115] The detailed process of LSTM quantization deployment on hardware platforms, namely PCs and FPGAs, is as follows: LSTM layers are divided into a set of regular layers, namely Long Short-Term Memory (LSTM) network layers. The computation process involves a combination of fully connected layers (FC), Eltwise layers (Eltwise-Add, Eltwise-Prod), and nonlinear layers (Sigmoid, Tanh), calculated in the order of the nine layers mentioned above. The LSTM network layer set is appropriately connected to other regular layers of the model to achieve the calculation of quantization parameters. By using the LSTM network layer set to update the initial neural network model on the hardware platform, the corresponding intermediate neural network models are obtained.
[0116] Step 205: Use the intermediate neural network model and the transmission line insulator defect dataset for quantitative calibration to generate a quantitative parameter sequence.
[0117] Furthermore, the intermediate neural network model includes a set of normal layers and long short-term memory network layers, and step 205 may include the following sub-steps S21-S27:
[0118] S21. Based on the time step corresponding to the intermediate neural network model, construct time series image groups and different image groups using the transmission line insulator defect dataset.
[0119] S22. Use different image groups and time series image groups to perform quantization settings and construct a target quantization calibration set.
[0120] S23. Use the target quantization calibration set to quantize and calibrate the transmission line insulator defect dataset, generating multiple data sets.
[0121] S24. Use the target quantization calibration set as input to the normal layer for quantization, and generate the normal layer tensor sequence and quantization step size.
[0122] S25. Determine if the quantization step size is less than the time step size. If yes, execute S26; otherwise, execute S27.
[0123] S26. Input all data sets into the Long Short-Term Memory network layer set for tensor calculation to generate a quantization parameter sequence.
[0124] S27. Use the normal layer tensor sequence as the quantization parameter sequence.
[0125] The normal layer includes regular layers and undecomposed long short-term memory network layers. The target quantization calibration set refers to the quantization calibration set obtained by quantizing the initial quantization calibration set using a time-series image group and a stepwise combination strategy of different image groups.
[0126] In this embodiment of the invention, the LSTM quantization calibration image design incorporates a neural network model with both rule layers and LSTM layers. The quantization calibration set of the network model built solely for the rule layers of transmission line insulator defects is relatively simple, and a certain number of different image groups with different categories, backgrounds, angles, and lighting are selected. The data processed by LSTM is typically time-series, meaning that data is collected at different times over a period of time for the described transmission line insulator defect sample dataset. Therefore, a step-by-step combination strategy for time-series image groups and different image groups is designed.
[0127] Assuming the time step of the LSTM layer is T, the model input size is C×W×H. Therefore, N different image groups with different categories, backgrounds, angles, and lighting are selected. Each image group contains a time-series dataset with training consistency, i.e., the quantization calibration set has a dimension of N×T. On one hand, the combined images are used for quantization calibration of typical layers. On the other hand, when encountering the LSTM layer, different image groups are progressively sent to each time step N according to the LSTM's time step, where each different image group has time-series features. The quantization calibration process is as follows... Figure 3 As shown, when operating on power grid-related transmission line insulator defect data, different combination modes are used for quantization calibration to construct a target quantization calibration set. The target quantization calibration set is then used to quantize and calibrate the transmission line insulator defect dataset, dividing it into multiple data groups, such as group 1, group 2, ..., group n, with the number of data groups equal to the time step. The quantized target quantization calibration set is then input into the model for quantization at the normal layer. Afterwards, the time step is determined. If the quantization step t is less than the time step T (i.e., the maximum value has not been reached), the dataset enters the model and undergoes tensor calculations through a Long Short-Term Memory (LSTM) network layer set. Corresponding point operations and NOT operations are performed at each layer. After these calculations, a power grid-related tensor sequence, i.e., the quantization parameter sequence, is obtained. If the quantization step t is greater than or equal to the time step T, the normal layer tensor sequence is used as the quantization parameter sequence.
[0128] Furthermore, step S26 may include the following sub-steps S261-S268:
[0129] S261. Input all data sets into the first fully connected layer to generate the initial quantization calibration dataset.
[0130] S262. Determine whether the continuity identifier corresponding to the initial quantization calibration dataset is in a preset state.
[0131] S263. If so, then the intermediate initial quantization calibration dataset is generated by performing point addition and nonlinear calculations using the initial quantization calibration dataset through the second fully connected layer, the first added layer and the first nonlinear layer.
[0132] S264. If not, then use the initial quantization calibration dataset to perform point addition and nonlinear calculations through the first added layer and the first nonlinear layer to generate an intermediate quantization calibration dataset.
[0133] S265. Determine whether the continuity identifier corresponding to the intermediate quantization calibration dataset is in a preset state.
[0134] S266. If so, then the target quantization calibration dataset is generated by performing dot product, dot addition and nonlinear calculations on the intermediate quantization calibration dataset through the first element-wise multiplication layer, the second element-wise multiplication layer, the second added layer, the second nonlinear layer and the third element-wise multiplication layer.
[0135] S267. If not, then the target quantization calibration dataset is generated by performing nonlinear calculations and dot product calculations using the intermediate quantization calibration dataset through the second nonlinear layer and the third element-wise product layer.
[0136] S268. Construct a quantization parameter sequence using all tensor sequences corresponding to the target quantization calibration dataset.
[0137] In this embodiment of the invention, when generating quantization parameters, all groups of data are first sent to the rule layer. The activation quantization threshold is selected based on the output data distribution of this layer. The data dimension of each layer is N×T×C. l ×H l ×W l l represents the corresponding layer number; T represents the time step; C l ×H l ×W l The input size for each layer is denoted by ; N is the number of different image dataset groups. When encountering an LSTM layer, the input quantization calibration set is divided into tensors of equal dimensions based on the time step size. These tensors are used as inputs to the computational units in the LSTM. Weights and activation quantization thresholds are selected layer by layer based on the weights and activation output distribution range of the input dataset. For example... Figure 3As shown, all data sets are input into the first fully connected layer (the complete connection between input x and weight w) to generate the initial quantization calibration dataset. It is determined whether the continuity identifier Cont1 corresponding to the initial quantization calibration dataset is in a preset state ("Cont1 == 1?"). If so, the initial quantization calibration dataset is generated by performing dot product and nonlinear calculations using the initial quantization calibration dataset through the second fully connected layer (the complete connection between the hidden layer h and weight w), the first added layer, and the first nonlinear layer. The continuity identifier Cont2 corresponding to the intermediate quantization calibration dataset is then determined whether it is in a preset state ("Cont2 == 1?"). If so, the intermediate quantization calibration dataset is generated by performing dot product, dot product, and nonlinear calculations using the intermediate quantization calibration dataset through the first element-wise multiplication layer, the second element-wise multiplication layer, the second added layer, the second nonlinear layer, and the third element-wise multiplication layer. If not, the intermediate quantization calibration dataset is used for nonlinear calculations and dot product calculations through the second nonlinear layer and the third element-wise multiplication layer to generate the target quantization calibration dataset. If the tensor computation state corresponding to the target quantization calibration dataset is that the tensor computation corresponding to the quantization step size is not completed, then proceed to step S262 to determine whether the continuity identifier corresponding to the initial quantization calibration dataset is in a preset state. If the tensor computation state corresponding to the target quantization calibration dataset is that the tensor computation corresponding to the quantization step size is completed, then all tensor sequences corresponding to the target quantization calibration dataset are used to construct a quantization parameter sequence as the output of the LSTM layer. At this time, if there is still a rule layer after the LSTM layer, then the output dataset is calibrated to the subsequent layer to obtain the accuracy and benefit values of the transmission line insulator defects as the model changes.
[0138] Step 206: Use the quantized parameter sequence and intermediate neural network model to perform classification prediction and determine the target neural network model.
[0139] Furthermore, step 206 may include the following sub-steps S31-S34:
[0140] S31. Use the quantized parameter sequence to predict the range according to the preset range threshold, and determine the floating-point data corresponding to each layer of the intermediate neural network model.
[0141] S32. Map floating-point data to low-precision data using a neural network accelerator.
[0142] S33. Normalize the low-precision data to generate an effective real number space.
[0143] S34. Evaluate the classification accuracy based on the intermediate neural network model and the effective real number space, and determine the target neural network.
[0144] The preset range threshold refers to the critical value of the floating range of the input, weight and output data of each layer of the neural network model. The preset range threshold is set based on the activation qualitative of a set of quantized calibration images.
[0145] In this embodiment of the invention, the PC-side experiments were conducted on Windows 10. The CPU was an Intel(R) Core(TM) i7-8700K, 3.70GHz, the GPU was an NVIDIA GeForce GTX1070, and the deep learning frameworks were PyTorch 1.4.1 and Caffe. The FPGA-side experiments used the TIANJI NPU3.0 neural network accelerator. This accelerator is implemented based on the Xilinx ZCU102 FPGA and features controllable IP and an application development toolchain.
[0146] A guideline file is generated using a neural network accelerator, resulting in quantization software. This software maps floating-point data to low-precision data, pre-analyzing the distribution and range of input, weights, and output data for each layer of the neural network model. Quantization parameter sequences are used to predict the range according to preset thresholds, determining the corresponding floating-point data for each layer of the intermediate neural network model. Each floating-point value is represented by a low-order integer, and the output of the current layer is used as the input for the next layer. Before obtaining the final result, softmax is used to normalize the low-precision data, mapping the real-number domain of the linear model output to the effective real-number space [0,1] representing the probability distribution. Simulation software is then used to simulate the runtime and NPU computation process, verifying the correctness of the hardware computation results. Based on the intermediate neural network model and the effective real-number space, classification accuracy is evaluated, and the target neural network is determined. The quantization software uses layers as the basic processing unit, with quantization operations inserted into the weights and outputs of each layer.
[0147] Furthermore, step S34 may include the following sub-steps S341-S345:
[0148] S341. The relative entropy of the transmission line insulator defect dataset is calculated using an intermediate neural network model to generate the relative entropy.
[0149] S342. The maximum value is calculated by using an intermediate neural network model to generate the maximum value of the insulator defect dataset of the transmission line.
[0150] S343. Calculate the maximum average value of the transmission line insulator defect dataset using an intermediate neural network model to generate the maximum average value.
[0151] S344. Classify the relative entropy, maximum value, and maximum average value with the corresponding values in the effective real number space to evaluate the accuracy and generate accuracy evaluation data.
[0152] S345. Update the intermediate neural network model using the accuracy evaluation data to generate the target neural network model.
[0153] In this embodiment of the invention, the LSTM layer activation quantization mapping method includes KL diversion (relative entropy), MAX (maximum value), AVG MAX (maximum average value), COSine, ADMM, etc. Here, the first three methods are selected for model classification accuracy testing. The relative entropy, maximum value, and maximum average value corresponding to the transmission line insulator defect dataset are calculated using an intermediate neural network model. By calculating the difference between the relative entropy, maximum value, and maximum average value and the corresponding values in the effective real number space, and then calculating the ratio between these values, the corresponding accuracy evaluation data is generated.
[0154] For video classification tasks, two neural network test models for transmission line insulator defect samples can be selected. The test model, using the Vgg16 model as the backbone network, is a 52-class classification model that includes both regularized operators (such as convolution) and emerging complex operators (such as LSTM). After quantization processing according to the above steps, time-series images are extracted sequentially from image and sequence features to finally obtain the classification prediction results for insulator defect golf swings. The insulator defect golf swing is an example in the Vgg16 network.
[0155] In this embodiment of the invention, a test dataset is selected from a preset video classification dataset based on a transmission line insulator defect dataset. The test dataset is used for quantization settings to construct an initial quantization calibration set. The preset neural network model is updated using the initial quantization calibration set to generate an initial neural network model. The long short-term memory (LSTM) network layer in the initial neural network model is decomposed to generate an intermediate neural network model. Quantization calibration is performed using the intermediate neural network model and the transmission line insulator defect dataset to generate a quantization parameter sequence. Classification prediction is performed using the quantization parameter sequence and the intermediate neural network model to determine the target neural network model. By splitting the LSTM layer into multiple rule layers supported by a neural network accelerator, and considering the time-series properties of the LSTM layer in the stepwise combination strategy of the quantization calibration set, the proposed method not only meets the accuracy and speed requirements of complex time-series prediction tasks, but also quickly and efficiently implements neural network accelerator support for the LSTM layer on an embedded platform. Without sacrificing model accuracy and execution efficiency, the model size can be effectively compressed, saving storage space and computing resources.
[0156] Please see Figure 4 , Figure 4 This is a structural block diagram of the neural network quantization deployment system provided in Embodiment 3 of the present invention.
[0157] Example 3 of this invention provides a neural network quantization deployment system, comprising:
[0158] The initial neural network model generation module 401 is used to obtain a dataset of insulator defects in transmission lines, and to configure the preset neural network model using the dataset of insulator defects in transmission lines to generate the initial neural network model.
[0159] The intermediate neural network model generation module 402 is used to decompose the long short-term memory network layer in the initial neural network model to generate an intermediate neural network model.
[0160] The quantization parameter sequence generation module 403 is used to perform quantization calibration using an intermediate neural network model and a transmission line insulator defect dataset to generate a quantization parameter sequence.
[0161] The target neural network model determination module 404 is used to perform hardware simulation calculations using a quantized parameter sequence and an intermediate neural network model to determine the target neural network model.
[0162] Optionally, the initial neural network model generation module 401 includes:
[0163] The test dataset selection module is used to obtain the transmission line insulator defect dataset and select the test dataset from the preset video classification dataset according to the transmission line insulator defect dataset.
[0164] The quantization calibration set construction module is used to construct an initial quantization calibration set by performing quantization settings on a test dataset.
[0165] The initial neural network model generation submodule is used to update the preset neural network model using the initial quantization calibration set to generate the initial neural network model.
[0166] Optionally, the intermediate neural network model generation module 402 includes:
[0167] The Long Short-Term Memory (LSTM) network layer set generation module is used to decompose the LTM network layers in the initial neural network model and generate the LTM network layer set corresponding to the initial LTM network.
[0168] The Long Short-Term Memory (LSTM) network layer set consists of a first fully connected layer, a second fully connected layer, a first additive layer, a first non-linear layer, a first element-wise multiplication layer, a second element-wise multiplication layer, a second additive layer, a second non-linear layer, and a third element-wise multiplication layer, connected in sequence.
[0169] The intermediate neural network model generation submodule is used to update the initial neural network model using a set of long short-term memory network layers to generate an intermediate neural network model.
[0170] Optionally, the intermediate neural network model includes a set of normal layers and long short-term memory network layers, and the quantization parameter sequence generation module 403 includes:
[0171] The time series image group and different image group construction module is used to construct time series image groups and different image groups using the transmission line insulator defect dataset according to the time step corresponding to the intermediate neural network model.
[0172] The target quantization calibration set construction module is used to construct a target quantization calibration set by using different image groups and time series image groups for quantization settings.
[0173] The data set generation module is used to quantize and calibrate the transmission line insulator defect dataset using the target quantization calibration set, generating multiple data sets.
[0174] The normal layer tensor sequence and quantization step size generation module is used to quantize the normal layer by taking the target quantization calibration set as input and generate the normal layer tensor sequence and quantization step size.
[0175] The quantization step size determination module is used to determine whether the quantization step size is less than the time step size.
[0176] The first submodule for generating quantization parameter sequences is used to input all data sets into the Long Short-Term Memory network layer set for tensor computation to generate quantization parameter sequences if the condition is met.
[0177] The second submodule generates the quantization parameter sequence, which, if not, uses the normal layer tensor sequence as the quantization parameter sequence.
[0178] Optionally, the first submodule for generating the quantization parameter sequence may perform the following steps:
[0179] All data sets are input into the first fully connected layer to generate the initial quantization calibration dataset;
[0180] Determine whether the continuity identifier corresponding to the initial quantization calibration dataset is in a preset state;
[0181] If so, then point addition and nonlinear calculations are performed on the initial quantization calibration dataset through the second fully connected layer, the first added layer and the first nonlinear layer to generate an intermediate initial quantization calibration dataset;
[0182] If not, then the intermediate quantization calibration dataset is generated by performing point addition and nonlinear calculations on the initial quantization calibration dataset using the first added layer and the first nonlinear layer.
[0183] Determine whether the continuity identifier corresponding to the intermediate quantization calibration dataset is in a preset state;
[0184] If so, the target quantization calibration dataset is generated by performing dot product, dot addition, and nonlinear calculations on the intermediate quantization calibration dataset through the first element-wise multiplication layer, the second element-wise multiplication layer, the second added layer, the second nonlinear layer, and the third element-wise multiplication layer.
[0185] If not, the target quantization calibration dataset is generated by performing nonlinear calculations and dot product calculations on the intermediate quantization calibration dataset through the second nonlinear layer and the third element-wise product layer.
[0186] A quantization parameter sequence is constructed using all tensor sequences corresponding to the target quantization calibration dataset.
[0187] Optionally, the target neural network model determination module 404 includes:
[0188] The floating-point data determination module is used to predict the range of each layer of the intermediate neural network model by using a quantization parameter sequence according to a preset range threshold.
[0189] The low-precision data generation module is used to map floating-point data into low-precision data through a neural network accelerator.
[0190] The effective real number space generation module is used to normalize low-precision data and generate an effective real number space.
[0191] The target neural network model determination submodule is used to determine the target neural network by evaluating the classification accuracy based on the intermediate neural network model and the effective real number space.
[0192] Optionally, the target neural network model determination submodule may perform the following steps:
[0193] The relative entropy is calculated by using an intermediate neural network model to generate a relative entropy from the defect dataset of transmission line insulators.
[0194] The maximum value is calculated from the defect dataset of transmission line insulators using an intermediate neural network model.
[0195] The maximum average value is calculated from the defect dataset of transmission line insulators using an intermediate neural network model, thus generating the maximum average value.
[0196] The relative entropy, maximum value, and maximum average value are respectively compared with the numerical values corresponding to the effective real number space to evaluate the classification accuracy and generate accuracy evaluation data.
[0197] The intermediate neural network model is updated using accuracy assessment data to generate the target neural network model.
[0198] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor performs a neural network quantization deployment method as described in any of the above embodiments.
[0199] The memory can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. The memory has storage space for program code used to perform any of the method steps described above. For example, the storage space for program code may include individual program codes for implementing the various steps in the methods described above. This program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact discs (CDs), memory cards, or floppy disks. The program code may be compressed, for example, in a suitable form. When run by a computing processing device, this code causes the computing processing device to perform the various steps in the neural network quantization deployment method described above.
[0200] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the neural network quantization deployment method as described in any of the above embodiments.
[0201] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0202] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0203] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0204] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0205] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0206] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A neural network quantization deployment method, characterized in that, The method comprises the following steps: acquiring a power transmission line insulator defect data set, configuring a preset neural network model with the power transmission line insulator defect data set to generate an initial neural network model; decomposing a long short-term memory network layer in the initial neural network model to generate an intermediate neural network model; quantitative calibration is performed on the intermediate neural network model and the power transmission line insulator defect data set to generate a quantization parameter sequence; classification prediction is performed on the quantization parameter sequence and the intermediate neural network model to determine a target neural network model; the step of decomposing the long short-term memory network layer in the initial neural network model to generate an intermediate neural network model comprises: decomposing the long short-term memory network layer in the initial neural network model to generate a long short-term memory network layer set corresponding to an initial long short-term memory network; the long short-term memory network layer set comprises a first full connection layer, a second full connection layer, a first addition graph layer, a first nonlinear layer, a first element-wise multiplication layer, a second element-wise multiplication layer, a second addition graph layer, a second nonlinear layer and a third element-wise multiplication layer connected in sequence; the initial neural network model is updated using the long short-term memory network layer set to generate an intermediate neural network model; the intermediate neural network model comprises a normal layer and the long short-term memory network layer set; the step of performing quantitative calibration on the intermediate neural network model and the power transmission line insulator defect data set to generate a quantization parameter sequence comprises: constructing a time sequence image group and different image groups using the power transmission line insulator defect data set according to a time step corresponding to the intermediate neural network model; performing quantitative setting on the different image groups and the time sequence image group to construct a target quantitative calibration set; quantitative calibration is performed on the power transmission line insulator defect data set using the target quantitative calibration set to generate a plurality of data groups; the target quantitative calibration set is input into the normal layer to perform quantization to generate a normal layer tensor sequence and a quantization step; determining whether the quantization step is smaller than the time step; if yes, all the data groups are input into the long short-term memory network layer set to perform tensor calculation to generate a quantization parameter sequence; if no, the normal layer tensor sequence is taken as a quantization parameter sequence.
2. The neural network quantization deployment method of claim 1, wherein, The step of acquiring a power transmission line insulator defect data set and configuring a preset neural network model with the power transmission line insulator defect data set to generate an initial neural network model comprises: acquiring a power transmission line insulator defect data set, selecting a test data set from a preset video classification data set according to the power transmission line insulator defect data set; performing quantitative setting on the test data set to construct an initial quantitative calibration set; updating a preset neural network model using the initial quantitative calibration set to generate an initial neural network model.
3. The neural network quantization deployment method of claim 1, wherein, The step of inputting all the data groups into the long short-term memory network layer set to perform tensor calculation to generate a quantization parameter sequence comprises: inputting all the data groups into the first full connection layer to generate an initial quantitative calibration data set; determining whether the continuity identifier corresponding to the initial quantization calibration dataset is in a preset state; if yes, generating an intermediate initial quantization calibration dataset by performing point addition and nonlinear calculation on the initial quantization calibration dataset through the second full connection layer, the first addition graph layer and the first nonlinear layer; if no, generating an intermediate quantization calibration dataset by performing point addition and nonlinear calculation on the initial quantization calibration dataset through the first addition graph layer and the first nonlinear layer; determining whether the continuity identifier corresponding to the intermediate quantization calibration dataset is in the preset state; if yes, generating a target quantization calibration dataset by performing point product, point addition and nonlinear calculation on the intermediate quantization calibration dataset through the first element-wise multiplication layer, the second element-wise multiplication layer, the second addition graph layer, the second nonlinear layer and the third element-wise multiplication layer; if no, generating a target quantization calibration dataset by performing nonlinear calculation and point product calculation on the intermediate quantization calibration dataset through the second nonlinear layer and the third element-wise multiplication layer; using all tensor sequences corresponding to the target quantization calibration dataset to construct a quantization parameter sequence.
4. The neural network quantization deployment method of claim 1, wherein, The step of using the quantization parameter sequence and the intermediate neural network model to perform classification prediction to determine a target neural network model comprises: using the quantization parameter sequence to perform range prediction according to a preset range threshold to determine floating point data corresponding to each layer of the intermediate neural network model; mapping the floating point data into low-precision data through a neural network accelerator; performing normalization processing on the low-precision data to generate an effective real number space; performing classification precision evaluation according to the intermediate neural network model and the effective real number space to determine a target neural network.
5. The neural network quantization deployment method of claim 4, wherein, The step of performing classification precision evaluation according to the intermediate neural network model and the effective real number space to determine a target neural network comprises: performing relative entropy calculation on the power line insulator defect dataset through the intermediate neural network model to generate relative entropy; performing maximum value calculation on the power line insulator defect dataset through the intermediate neural network model to generate a maximum value; performing maximum average value calculation on the power line insulator defect dataset through the intermediate neural network model to generate a maximum average value; performing classification precision evaluation on the relative entropy, the maximum value and the maximum average value respectively with respect to the values corresponding to the effective real number space to generate precision evaluation data; updating the intermediate neural network model using the precision evaluation data to generate a target neural network model.
6. A neural network quantization deployment system, comprising: comprises: an initial neural network model generation module configured to obtain a power line insulator defect dataset, configure a preset neural network model with the power line insulator defect dataset, and generate an initial neural network model; an intermediate neural network model generation module configured to decompose a long short-term memory network layer in the initial neural network model to generate an intermediate neural network model; and an intermediate neural network model generation module configured to decompose a long short-term memory network layer in the initial neural network model to generate an intermediate neural network model. The quantization parameter sequence generation module is configured to perform quantization calibration on the power line insulator defect dataset by using the intermediate neural network model to generate a quantization parameter sequence. The target neural network model determination module is configured to perform hardware simulation calculation on the intermediate neural network model by using the quantization parameter sequence to determine a target neural network model. The intermediate neural network model generation module comprises: The long short-term memory network layer set generation module is configured to decompose the long short-term memory network layer in the initial neural network model to generate a long short-term memory network layer set corresponding to the initial long short-term memory network. The long short-term memory network layer set comprises a first full connection layer, a second full connection layer, a first addition graph layer, a first nonlinear layer, a first element-wise multiplication layer, a second element-wise multiplication layer, a second addition graph layer, a second nonlinear layer, and a third element-wise multiplication layer connected in sequence. The intermediate neural network model generation submodule is configured to update the initial neural network model by using the long short-term memory network layer set to generate an intermediate neural network model. The intermediate neural network model comprises a normal layer and the long short-term memory network layer set; and the quantization parameter sequence generation module comprises: The time series image group and different image group construction module is configured to construct a time series image group and a different image group by using the power line insulator defect dataset according to a time step corresponding to the intermediate neural network model. The target quantization calibration set construction module is configured to perform quantization setting on the different image group and the time series image group to construct a target quantization calibration set. The data group generation module is configured to perform quantization calibration on the power line insulator defect dataset by using the target quantization calibration set to generate a plurality of data groups. The normal layer tensor sequence and quantization step generation module is configured to input the normal layer to perform quantization by using the target quantization calibration set to generate a normal layer tensor sequence and a quantization step. The quantization step judgment module is configured to judge whether the quantization step is smaller than the time step. The quantization parameter sequence generation first submodule is configured to input all the data groups to the long short-term memory network layer set to perform tensor calculation to generate a quantization parameter sequence if the quantization step is smaller than the time step. The quantization parameter sequence generation second submodule is configured to use the normal layer tensor sequence as a quantization parameter sequence if the quantization step is not smaller than the time step.
7. An electronic device, comprising: The computer program is executed to implement the neural network quantization deployment method according to any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed to implement the neural network quantization deployment method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Insulation resistance calculation method based on neural network and electronic device
CN109754070A
Line loss prediction method and system based on LSTM neural network
CN111639783A