CN-117688391-B - Precision analysis method of network model and electronic equipment
Abstract
The embodiment of the invention discloses a precision analysis method of a network model and electronic equipment, which are characterized in that output data of a target network model deployed on a first processor and a second processor are respectively obtained, the output data of the first processor and the output data of the second processor are respectively preprocessed, at least one corresponding data pair is obtained, first data and second data in the data pair are input into a pre-trained data processing model for comparison, a data matching result is determined, and precision information of the target network model is determined according to the data matching result. Therefore, the whole network data comparison efficiency can be improved while the whole network comparison of different processors is realized.
Inventors
- WANG KAI
Assignees
- 北京希姆计算科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220830
Claims (8)
- 1. A method for analyzing accuracy of a network model, the method comprising: respectively obtaining output data of a target network model deployed on a first processor and a second processor, wherein the output data comprises output sub-data of each node in the target network model; preprocessing each output data respectively to obtain at least one corresponding data pair, wherein the data pair comprises first data and second data; Inputting each data pair into a pre-trained data processing model for comparison processing, and determining a data matching result of two data in each data pair, wherein the data processing model is a model for comparing the similarity of first data and second data in the data pair; determining precision information of the target network model according to the data matching result; the preprocessing is performed on each output data, and the obtaining of at least one corresponding data pair includes: Respectively carrying out data slicing on output sub-data corresponding to the first processor and the second processor to obtain a plurality of first data and a plurality of second data, wherein the data formats of the first data and the second data are the same; Determining the first data and the second data corresponding to the same position as a data pair, or The preprocessing is performed on each output data, and the obtaining of at least one corresponding data pair includes: And determining output sub-data output by the target network model on the first processor and the second processor at the same node as the data pair.
- 2. The method for analyzing the accuracy of the network model according to claim 1, wherein the data processing model is a twin network model, and the structure of the data processing model includes a first branch network and a second branch network; Inputting each data pair into a pre-trained data processing model for comparison processing, wherein determining the data matching result of two data in each data pair comprises the following steps: and respectively inputting the first data and the second data in the data pair into the first branch network and the second branch network for processing so as to acquire the data matching result.
- 3. The method for analyzing accuracy of a network model according to claim 1, wherein the performing data slicing on output sub-data corresponding to the first processor and the second processor to obtain a plurality of first data and a plurality of second data includes: And in response to that the data quantity remained after the output sub-data of the same node are diced according to the data format is not in accordance with the data format requirement, filling the output sub-data in sequence to obtain last first data and last second data with the same data format, wherein the last first data and the last second data form a data pair.
- 4. The method of accuracy analysis of a network model according to claim 1, wherein the data processing model is trained based on the steps of: Acquiring training data based on at least one pre-aligned training network model, wherein the training data comprises a matching degree mark; And inputting the training data into the data processing model for processing so as to train the data processing model.
- 5. The method of claim 4, wherein the obtaining training data based on the pre-aligned at least one training network model comprises: Inputting data to be processed into a training network model deployed on a first processor for processing, and obtaining first output sub-data respectively output by each node; inputting data to be processed into a training network model deployed on a second processor for processing, and obtaining second output sub-data respectively output by each node; performing data slicing on each first output sub data and each second output sub data to obtain training data pairs; And marking the matching degree of each training data pair based on the matching degree of the first output sub data and the second output sub data output by at least one same node.
- 6. The method according to claim 5, wherein the matching each training data pair based on the matching degree of the first output sub-data and the second output sub-data output by at least one identical node comprises: In response to the degree of matching of the first output sub-data and the second output sub-data output by the termination node reaching a matching threshold, marking the degree of matching of each training data pair as a first value; Determining the matching degree of the first output sub data and the second output sub data of each node in response to the matching degree of the first output sub data and the second output sub data output by the termination node being smaller than the matching threshold; for a node, marking the matching degree of training data pairs corresponding to the node as a first value in response to the matching degree of first output sub-data and second output sub-data of the node reaching the matching threshold; Determining the matching degree of the training data pair corresponding to the node in response to the matching degree of the first output sub-data and the second output sub-data of the node being smaller than the matching threshold; and marking the matching degree of the training data pair with the matching degree reaching the matching threshold value as a first value, and marking the matching degree of the training data pair with the matching degree smaller than the matching threshold value as a second value.
- 7. The method for analyzing accuracy of network model according to claim 5 or 6, wherein the step of performing data slicing on each of the first output sub-data and the second output sub-data, the step of obtaining training data pairs includes: Performing data slicing on each first output sub data and each second output sub data to obtain an initial training data pair; and carrying out data augmentation on each initial training data pair to obtain each training data pair.
- 8. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-7.
Description
Precision analysis method of network model and electronic equipment Technical Field The present invention relates to the field of computer technologies, and in particular, to a method for analyzing accuracy of a network model and an electronic device. Background Along with the progress of technology, artificial intelligence plays an increasingly important role in our life, especially the development of modern artificial intelligence taking deep neural networks as main technical means, and at present, the deep neural networks have played an extremely important role in the fields of traffic, finance, medical treatment and the like. As the amount of data to be processed by the deep neural network is larger, many deep neural networks need to be deployed on processors with relatively high computing power (such as NPU processors, etc.), and the deep neural networks deployed on these processors are an essential step in whole network accuracy analysis. Disclosure of Invention In view of this, the embodiment of the invention provides a method for analyzing accuracy of a network model and an electronic device, so as to improve overall network data comparison efficiency while realizing overall network comparison of different processors. In a first aspect, an embodiment of the present invention provides a method for analyzing accuracy of a network model, where the method includes: respectively obtaining output data of a target network model deployed on a first processor and a second processor; preprocessing each output data respectively to obtain at least one corresponding data pair; inputting each data pair into a pre-trained data processing model for comparison processing, and determining a data matching result of two data in each data pair; And determining the precision information of the target network model according to the data matching result. In an optional implementation manner, the output data comprises output sub-data of each node in the target network model, and the data pair comprises first data and second data, wherein the first data and the second data are respectively preprocessing data of the output sub-data of the same node corresponding to the first processor and the second processor. In an alternative implementation manner, the data processing model is a twin network model, and the structure of the data processing model comprises a first branch network and a second branch network; In an alternative implementation manner, the data pairs are input into a pre-trained data processing model to be compared, and determining the data matching result of two data in each data pair comprises the steps of inputting first data and second data in the data pair into the first branch network and the second branch network to be processed respectively so as to obtain the data matching result. In an alternative implementation manner, preprocessing each output data respectively to obtain at least one corresponding data pair includes respectively performing data dicing on output sub-data corresponding to the first processor and the second processor to obtain a plurality of first data and a plurality of second data, wherein the data formats of the first data and the second data are the same, and the first data and the second data corresponding to the same position are determined to be the data pair. In an optional implementation manner, the data slicing is performed on output sub-data corresponding to the first processor and the second processor respectively to obtain a plurality of first data and a plurality of second data, and the method includes sequentially filling the output sub-data to obtain last first data and last second data with the same data format in response to that the data amount of the output sub-data of the same node after being sliced according to the data format does not meet the data format requirement, wherein the last first data and the last second data form a data pair. In an alternative implementation, the method further includes determining an initial node having a degree of match less than a match threshold to locate the faulty node in response to the degree of match of the output data of the first and second processors being less than the match threshold. In an alternative implementation, a data processing model is trained based on the steps of obtaining training data based on at least one pre-aligned training network model, the training data including a match-making tag, and inputting the training data into the data processing model for processing to train the data processing model. In an optional implementation manner, the obtaining training data based on the at least one pre-aligned training network model includes inputting data to be processed into a training network model deployed on a first processor for processing, obtaining first output sub-data respectively output by each node, inputting the data to be processed into a training network model deployed on a second processor for processi