A model performance reasoning method and device based on dynamic timing diagram
By mapping the training process of the neural network model into a time evolution graph, extracting node features and constructing timing features, the problem of dynamic change capture of neural network structure during training is solved, and the predictability and training efficiency of neural network model performance are improved.
Patent Information
- Application Number
- CN202210215486.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-03-07
AI Technical Summary
The prior art is difficult to effectively capture and analyze the dynamic changes of neural network structures during training, resulting in high uncertainty in model performance prediction.
A model performance inference method based on dynamic timing chart is proposed. By mapping the training process of neural network model into a time evolution chart, node features in the time evolution chart are extracted, and timing features are constructed to train the performance prediction classifier.
This method can reduce the uncertainty of neural network training results, improve model training efficiency, and effectively complete model performance inference through performance prediction classifiers.
Smart Images

Figure CN114818459B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and image classification, and in particular to a model performance reasoning method based on a dynamic timing diagram. Background Art
[0002] Neural networks have driven the development of many fields, including computer vision, image processing, natural language processing, and bioinformatics. As the complexity of tasks increases, networks become deeper and larger, requiring more computing resources, training data, and time. However, even if a lot of training resources and training time are consumed, the final performance of the neural network is uncertain. For example, using an inappropriate learning rate during the model training phase results in poor final performance of the model.
[0003] Many big data are presented in the form of large-scale graphs or networks. Many non-graph-structured big data are often converted into graph models for analysis. The graph data structure expresses the correlation between data well. Some past work has attempted to understand and explain the internal mechanisms of deep neural networks. One way to achieve this goal is to represent the neural network as its underlying graph structure and study selected graph properties such as clustering coefficient, path length, and modularity. For example, in 2020, You et al. represented the network as a relational graph that captures the message passing process and studied the correlation between the network's predictive performance and architectural changes. However, research on neural network structures as graphs is relatively limited, and the structural changes of the underlying graph during training are mostly ignored in the literature.
[0004] Based on the above considerations, the present invention proposes a model performance reasoning method based on dynamic timing diagrams, which captures the early neural network dynamics in the training phase to predict the performance of the neural network. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention proposes a model performance reasoning method and device based on a dynamic timing diagram.
[0006] In order to achieve the above technical objectives, the technical solution of the present invention is:
[0007] A first aspect of an embodiment of the present invention provides a model performance reasoning method based on a dynamic timing diagram, comprising the following steps:
[0008] (1) Select a data set, build a seed model, set model training parameters, use the data set to train the seed model, and obtain a checkpoint of the seed model;
[0009] (2) reading the checkpoint of the seed model generated in step (1), initializing an undirected weighted graph, and mapping the seed model into a time evolution graph;
[0010] (3) Calculate the eigenvector centrality corresponding to the time evolution graph to obtain the graph node features;
[0011] (4) The graph at time t in the time evolution graph obtained in step (2) is called the time static graph. The statistical features of the static graph at each time are calculated using the graph node features, and the time series features are obtained by aggregation.
[0012] (5) Construct a loss function based on time series features, train a performance prediction classifier, and complete model performance inference through the performance prediction classifier.
[0013] Furthermore, the data set is a data set including Cifar10, Cifar100 or Mnist; the seed model is a deep learning model including Lenet5, VGG, Resnet.
[0014] Furthermore, the seed model construction is specifically: changing the learning rate and random inactivation rate of the seed model training to generate a sufficient number of seed models Where lr_n and drop_n represent the number of different learning rates and different random dropout rates, respectively.
[0015] Furthermore, the training seed model is specifically:
[0016] set up is a neural network at a learning rate lr i and dropout rate drop j Under this condition, the model set obtained by training iterations T times; each Represents the checkpoint saved at training time t, that is, the weight parameter θ of the model at time t; each model set The training loss function is:
[0017]
[0018] Where x represents the image sample participating in the training, y represents the true label corresponding to the x sample, lr represents the learning rate set by the model set, drop represents the random inactivation rate set by the model set, θ represents the weight parameter that the model needs to update, class_n represents the number of categories of the classification task, and yi represents the true distribution of sample x in category i. Represents the predicted distribution of sample x in category i.
[0019] Furthermore, the step (2) is specifically as follows:
[0020] (2.1) Read the neural network model checkpoint:
[0021] Read the checkpoint saved by the seed model generated in step (1) Save to matrix θ; = where θ contains all the parameters of the model, K i It represents the kernel of the i-th layer of the model, and for the convolutional layer, there is f i filters; for the fully connected layer, there are f i neurons; the number of model layers is deep_n, and the number of nodes is node_n;
[0022] (2.2) Initialization graph
[0023] The figure is an undirected weighted graph; the K i The filters or neurons of the layer Mapping to Node That is, in K i Layer creation i nodes and are represented as Assume that the node attributes of the graph are empty, and the weight edge between the nodes of two adjacent layers is That is, the initialization graph is
[0024] (2.3) Mapping the seed model to the graph Specifically:
[0025] The model The weight θ is mapped to the graph It is specifically expressed as the following formula:
[0026]
[0027] Among them, ||·|| is the norm formula, is the kth filter of the i-th layer kernel, is the lth filter of the next layer of kernels, that is, Take the norm of the parameters between the two filters. is the weight edge between the kth node of the i-th layer core and the lth node of the j-th layer core; repeat the above steps until each layer parameter of the model is mapped to a graph
[0028] (2.4) Repeat the above steps (2.1) to (2.3) until All mapped as time evolution graphs All seed models N are mapped to a set of time evolution graphs
[0029] Furthermore, the step (3) is specifically as follows:
[0030] picture The calculation formula of the eigenvector centrality is as follows:
[0031]
[0032] Among them, A is the graph The adjacency matrix of -1 is the eigenvalue of matrix A; α is a vector used to measure the importance of each node in the graph, and is assigned to after reaching a steady state after multiple iterations.
[0033] The length of is the number of nodes in the graph; repeat the above formula until the time evolution graph The corresponding eigenvector centrality is calculated The time evolution graph set G is calculated
[0034] Furthermore, the step (4) specifically includes the following sub-steps:
[0035] (4.1) The graph at training time t in the time evolution graph obtained in step (2) is called the time static graph, and the statistical features of the static graph are calculated:
[0036] For each time static graph, five statistical features are introduced: mean, standard deviation, median, skewness and kurtosis; the formula is as follows:
[0037]
[0038]
[0039] med(x)=median(x)
[0040]
[0041]
[0042] Among them, x represents the graph The eigenvector centrality of n represents The length of the vector, i represents the index of the vector, represents the mean of the vector, and σ represents the variance of the vector; that is, the calculation results are Static statistical characteristics of
[0043] (4.2) Strengthening the static statistical characteristics of the graph
[0044] Redefine
[0045]
[0046] Among them, α is a constant, which indicates the influence of the feature at the previous moment on the current feature. If α = 1, there is no influence;
[0047] (4.3) Aggregate the static statistical features at each moment after strengthening in step (4.2) to form time series features;
[0048] (4.3) Repeat the above steps (4.1) to (4.3) until the time evolution diagram The eigenvector centrality of Calculate the time series characteristics EC is calculated
[0049] Furthermore, the step (5) specifically includes the following sub-steps:
[0050] (5.1) Establish performance labels to distinguish models with sufficient performance and models with insufficient performance;
[0051] Classify the seed model obtained in step (1), and the corresponding downstream classification task performance Use segmentation thresholds to map to class labels L = {l0,l1}; where l0 represents a model with insufficient performance and l1 represents a model with sufficient performance;
[0052] (5.2) Divide the training set and test set;
[0053] The performance sufficient model and performance insufficient model obtained in step (5.1) are divided into training set D train and the test set D test ; The training set D train Take 90% of l0 and 90% of l1 respectively, test set D test Take the remaining 10% of l0 and the remaining 10% of l1;
[0054] (5.3) Construct a loss function based on time series features, using the training set D in step (5.2) train Train the classifier to obtain a performance prediction classifier;
[0055] Customize the hyperparameters of the training classifier: number of training rounds, number of batch samples, gradient update rule; the loss function formula of the training classifier is as follows:
[0056]
[0057] Where ω is the weight parameter of the classifier; l i Indicates the optimal performance of model training, taking l0 or l1; is the predicted probability value of the model performance in the training iteration; until the classifier training loss function converges, a trained performance prediction classifier is obtained;
[0058] (5.4) The performance prediction classifier obtained by training in step (5.3) is used for model performance prediction;
[0059] The performance prediction classifier uses precision as the evaluation index of prediction performance; the test set D obtained in step (5.2) test Input into the performance prediction classifier to complete the model performance prediction.
[0060] A second aspect of an embodiment of the present invention provides a model performance reasoning device based on a dynamic timing diagram, comprising one or more processors for implementing the above-mentioned model performance reasoning method based on a dynamic timing diagram.
[0061] A third aspect of an embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, it is used for the above-mentioned model performance reasoning method based on dynamic timing diagram.
[0062] The beneficial effects of the present invention are as follows: the neural network model composition method proposed in the present invention is simpler and more computationally efficient than the expansion composition method in the existing convolution layer, and does not sacrifice the performance of the prediction task. The model performance prediction method proposed in the present invention solves the problem of neural network model performance prediction by capturing the neural network dynamics in the early stage of model training, which can reduce the uncertainty of neural network training results and improve model training efficiency. The method of the present invention can perform performance testing on any neural network instance using a trained performance classifier, and has wide applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0064] Figure 1 It is an overall flow chart of a model performance reasoning method based on a dynamic timing diagram provided by an embodiment of the present invention;
[0065] Figure 2 It is a simple example diagram of a model composition method of a model performance reasoning method based on a dynamic timing diagram provided by an embodiment of the present invention;
[0066] Figure 3 It is a schematic diagram of a model performance reasoning device based on a dynamic timing diagram provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0068] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0069] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0070] The following is a detailed description of the model performance reasoning method and device based on dynamic timing diagrams of the present invention in conjunction with the accompanying drawings. In the absence of conflict, the features of the following embodiments and implementations can be combined with each other.
[0071] In order to improve the training efficiency of deep neural network models and reduce the uncertainty of performance results of neural network models, this paper proposes a model performance reasoning method based on dynamic timing graphs, which uses the perspective of graphs to predict the performance of neural networks by capturing the early neural network dynamics in the training stage. Figure 1 As shown, the specific concept is: the model performance reasoning method based on dynamic timing diagram proposed in the present invention maps the training process of the neural network model into a time evolution diagram, extracts the node features in the time evolution diagram, and in order to predict the performance of heterogeneous models, it is proposed to further extract multidimensional statistical features in the node features, aggregate the multidimensional statistical features into timing features, and realize the prediction of model performance.
[0072] like Figure 2As shown in the example, the neural network model is mainly composed of two common structures: convolutional layer and fully connected layer. Each filter is represented as a node, and the connection between filters in adjacent layers is represented by weighted edges. On the left is a three-layer neural network model, and on the right is a graph of the model, corresponding to two convolutional layers and one FC layer respectively. As shown on the right, the nodes of the first and second layers represent the filters in the convolutional layer, and the nodes of the third layer represent the neurons in the fully connected layer. The weighted edge between node 6 and node 16 is calculated by the norm. Among them, the graph construction method of the fully connected layer is relatively simple, directly mapping the neurons in the fully connected layer to the nodes of the graph, and mapping the coefficients in the neurons to the weighted edges of the graph. Because the filter of the convolutional layer is a matrix, it is difficult to directly represent it as the weighted edge of the graph. In the past, there was work to expand the filter of the convolutional layer and map each parameter of the filter, but for models with more complex structures, there will be a problem of graph node explosion, and the calculation efficiency is low and the calculation cost is high. The convolutional layer composition method proposed in the present invention is relatively simple and efficient. It performs norm processing on the filter parameters of the convolutional layer, which is simpler and more computationally efficient than the existing expansion composition method in the convolutional layer, and does not sacrifice the performance of the prediction task.
[0073] In the embodiment of the present invention, Lenet5 is used as the structure of the seed model, which consists of three convolutional layers and two fully connected layers. The Cifar10 image dataset is used as the training set and test set of the seed model. The performance prediction classifier consists of a two-layer fully connected model.
[0074] Reference Figure 1-2 , the model performance reasoning method based on dynamic timing diagram, the steps are as follows:
[0075] (1) Select a data set, build a seed model, set model training parameters, and use the data set to train the seed model; specifically, the following sub-steps are included:
[0076] (1.1) Data initialization
[0077] In an embodiment of the present invention, the Cifar10 dataset is used as the training set and test set of the seed model. The Cifar10 dataset is a commonly used dataset for image classification models. The Cifar10 dataset contains a total of 60,000 color RGB images, each of which is 3*32*32 in size and is divided into 10 categories, with a total of 6,000 samples in each category. There are 50,000 training samples and 10,000 test samples. 30% of the images in each category are randomly selected as the test set, and the remaining images are used as the training set. The present invention takes 50,000 training samples of the Cifar10 dataset as the training set Data of the target model train_cifar10 , take the test set as the test set Data of the target model test_cifar10 .
[0078] (1.2) Build a seed model and initialize training
[0079] In order to make the final performance of the model have different classification accuracy, some hyperparameters of model training, such as learning rate and random inactivation rate (Dropout), are changed to generate enough seed models. Where lr_n and drop_n represent the number of different learning rates and different dropout rates, respectively, that is, there are lr_n*drop_n seed models in N. This corresponds to the performance accuracy of their downstream tasks (such as image classification tasks).
[0080] In this embodiment, there are 48 learning rates lr = {1, 0.15, ..., 4.5} * {10 -6 ,10 -5 ,...,10 -1} and 10 dropout rates drop_rate={0,0.1,...,0.9}, generating 480 seed models.
[0081] (1.3) Training seed model
[0082] set up A neural network is trained for T = 50 epochs at a specific learning rate and dropout rate. It is represented as the checkpoint saved at the t training time, that is, the weight parameter θ of the model at time t. The training loss function is:
[0083]
[0084] Among them, x represents the image sample Data involved in the training train_cifar10 , y represents the true label corresponding to the x sample, lr represents the learning rate set by the model set, drop represents the dropout rate set by the model set, θ represents the weight parameter that the model needs to update, class_n represents the number of categories of the classification task, and yi represents the true distribution of sample x in category i. It represents the predicted distribution of sample x in category i. In this embodiment, class_n is set to 10.
[0085] (2) Mapping of Neural Networks to Graphs
[0086] (2.1) Reading the neural network model checkpoint
[0087] Read the checkpoint file saved by the seed model generated in step (1) Save to matrix θ, which is represented as the weight parameter of the model. θ contains all the parameters of the model, K i It represents the kernel of the i-th layer of the model, and for the convolutional layer, there is f i filters; for the fully connected layer, there are f i The number of layers in the model is deep_n, and the number of nodes is node_n.
[0088] In this embodiment, deep_n is 5 and node_n is 239.
[0089] (2.2) Initialization graph
[0090] The graph is an undirected weighted graph, and the number of nodes and edge relationships of the graph are related to the model structure. i The filters or neurons of the layer Mapping to Nodes That is, in K i Layer creation i nodes and are represented as Assume that the node attributes of the graph are empty, and the weight edge between the nodes of two adjacent layers is That is, the initialization graph is
[0091] (2.3) Model mapping to graph
[0092] The model The weight θ is mapped to the graph It is specifically expressed as the following formula:
[0093]
[0094] Among them, ||·|| is the norm formula, is the kth filter of the i-th layer kernel, is the lth filter of the next layer of kernels, that is Take the norm of the parameters between the two filters. is the weight edge between the kth node of the i-th layer core and the lth node of the j-th layer core. Repeat the above steps until each layer parameter of the model is mapped to a graph.
[0095] (2.4) Repeat the above steps (2.1) to (2.3) until All mapped as time evolution graphs All seed models N are mapped to a set of time evolution graphs
[0096] (3) Calculate the eigenvector centrality of the time evolution graph, that is, obtain the graph node features, specifically:
[0097] picture The calculation formula of the eigenvector centrality is as follows:
[0098]
[0099] Among them, A is the graph The adjacency matrix of -1 is the eigenvalue of matrix A. α is a vector that measures the importance of each node in the graph and is assigned to In the embodiment of the present invention, The length of is the number of nodes in the graph, which is 239, that is, The dimension is 1*239.
[0100] Repeat the above formula until the time evolution diagram The corresponding eigenvector centrality is calculated The time evolution graph set G is calculated
[0101] (4) Temporal characteristics of the structural graph
[0102] (4.1) Calculate the statistical characteristics of static graphs
[0103] The graph at training time t in the time evolution graph obtained in step (2) is called the time static graph.
[0104] For the diagram The similarity between them introduces five statistical features for each time static graph: mean, standard deviation, median, skewness and kurtosis. Their calculation formulas are:
[0105]
[0106]
[0107] med(x)=median(x)
[0108]
[0109]
[0110] The x in the formula represents the graph The eigenvector centrality of n represents The length of the vector, i represents the index of the vector, represents the mean of the vector, and σ represents the variance of the vector. That is, the calculation results are Static statistical characteristics of The graph node features obtained in step (5) The dimension is compressed into a static statistical feature of 1*5 dimension.
[0111] (4.2) Strengthening the static statistical characteristics of the graph
[0112] In order to strengthen the importance of the static image at the current moment and the relationship between the static image at the previous moment, redefine
[0113]
[0114] Where α is a constant, indicating the influence of the feature at the previous moment on the current feature. If α=1, there is no influence.
[0115] (4.3) Aggregation to obtain time series features
[0116] To obtain the time evolution diagram The signature of step (4.2) is used to aggregate the static statistical features at each moment to form a time series feature:
[0117]
[0118] in Represents aggregation. It is a T*5 multidimensional matrix.
[0119] (4.3) Repeat the above steps (4.1) to (4.3) until the time evolution diagram The eigenvector centrality of Calculate the time series characteristics EC is calculated
[0120] (5) Train to obtain performance prediction classifier
[0121] (5.1) Establish performance labels to distinguish models with sufficient performance and models with insufficient performance;
[0122] The seed models obtained in step (1) are classified by performance, and their corresponding downstream classification task performance The segmentation threshold is mapped to the class label L = {l0,l1}, where l0 represents a model with insufficient performance and l1 represents a model with sufficient performance.
[0123] In this embodiment, a classification accuracy rate of 40% is used as a threshold to distinguish between l0 and l1.
[0124] (5.2) Divide the training set and test set
[0125] The performance sufficient model and performance insufficient model obtained in step (5.1) are divided into training set D train and the test set D testThe training set D train Take 90% of l0 and 90% of l1 respectively, test set D test Take the remaining 10% of l0 and the remaining 10% of l1.
[0126] (5.3) Construct a loss function based on time series features, using the training set D in step (5.2) train Train the classifier to obtain a performance prediction classifier; specifically:
[0127] In the embodiment of the present invention, the hyperparameters of the training classifier are set as follows: the number of training rounds is 20, the number of batch samples is 8, and the gradient update rule is Adam. The loss function of the training classifier is expressed as the following formula:
[0128]
[0129] Among them, ω is the weight parameter of the classifier. i Indicates the optimal performance of model training, which can be either l0 or l1. The predicted probability value for the model performance in the training iteration.
[0130] Until the classifier training loss function converges, the output is saved to obtain a classifier with sufficient performance.
[0131] (5.4) Use the performance prediction classifier obtained in step (5.3) to predict model performance
[0132] The performance prediction classifier in the present invention uses the accuracy rate (ACC) as the evaluation index of the prediction performance. The accuracy rate is an index to measure the classification accuracy of the classifier. The higher the accuracy rate, the better the performance of the performance prediction classifier. The accuracy rate formula is calculated as follows:
[0133]
[0134] TP represents the number of correctly classified samples, FP represents the number of incorrectly classified samples, and TP+FP represents the number of all classified samples.
[0135] The test set D obtained in step (5.2) test Input into the performance prediction classifier, the classification results are shown in Table 1.
[0136] Table 1 Classification results of training set and test set of performance prediction classifier
[0137]
[0138] As can be seen from Table 1, the model performance prediction method proposed in the present invention solves the problem of neural network model performance prediction by capturing the neural network dynamics in the early stage of model training, which can reduce the uncertainty of neural network training results, improve model training efficiency, and effectively complete model performance reasoning.
[0139] Corresponding to the aforementioned embodiment of the model performance reasoning method based on the dynamic timing diagram, the present invention also provides an embodiment of the model performance reasoning device based on the dynamic timing diagram.
[0140] See also Figure 3 A model performance reasoning device based on a dynamic timing diagram provided in an embodiment of the present invention includes one or more processors for implementing the model performance reasoning method based on a dynamic timing diagram in the above embodiment.
[0141] The embodiment of the model performance inference device based on dynamic timing diagram of the present invention can be applied to any device with data processing capability, and the device with data processing capability can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capability in which it is located reading the corresponding computer program instructions in the non-volatile memory into the internal memory for execution. From the hardware level, if Figure 3 As shown, it is a hardware structure diagram of any device with data processing capability where the model performance reasoning device based on the dynamic timing diagram of the present invention is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0142] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0143] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0144] An embodiment of the present invention further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the model performance reasoning method based on the dynamic timing diagram in the above embodiment is implemented.
[0145] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capability and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0146] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.
Claims
1. A model performance reasoning method based on dynamic timing diagram, characterized in that: The following steps are involved: (1) Select a data set, build a seed model, set model training parameters, use the data set to train the seed model, and obtain a checkpoint of the seed model; (2) reading the checkpoint of the seed model generated in step (1), initializing an undirected weighted graph, and mapping the seed model into a time evolution graph; The step (2) is specifically: (2.1) Read the neural network model checkpoint: Read the checkpoint saved by the seed model generated in step (1) Save to matrix θ; where θ contains all the parameters of the model, K i It represents the kernel of the i-th layer of the model, and for the convolutional layer, there is f i filters; for the fully connected layer, there are f i neurons; The number of model layers is deep_n, and the number of nodes is node_n; (2.2) Initialization graph The figure is an undirected weighted graph; the K i The filters or neurons of the layer Mapping to Node That is, in K i Layer creation i nodes and are represented as Assume that the node attributes of the graph are empty, and the weight edge between the nodes of two adjacent layers is That is, the initialization graph is (2.3) Mapping the seed model to the graph Specifically: The model The weight θ is mapped to the graph It is specifically expressed as the following formula: Among them, ||·|| is the norm formula, is the kth filter of the i-th layer kernel, is the lth filter of the next layer of kernels, that is Take the norm of the parameters between the two filters; is the weight edge between the kth node of the i-th layer core and the lth node of the j-th layer core; repeat the above steps until each layer parameter of the model is mapped to a graph (2.4) Repeat the above steps (2.1) to (2.3) until All mapped as time evolution graphs All seed models N are mapped to a set of time evolution graphs (3) Calculate the eigenvector centrality corresponding to the time evolution graph to obtain the graph node features; (4) The graph at time t in the time evolution graph obtained in step (2) is called the time static graph. The statistical features of the static graph at each time are calculated using the graph node features, and the time series features are obtained by aggregation. (5) Construct a loss function based on time series features, train a performance prediction classifier, and complete model performance reasoning through the performance prediction classifier; The step (5) specifically includes the following sub-steps: (5.1) Establish performance labels to distinguish models with sufficient performance and models with insufficient performance; Classify the seed model obtained in step (1), and the corresponding downstream classification task performance Use segmentation thresholds to map to class labels L = {l0,l1}; where l0 represents a model with insufficient performance and l1 represents a model with sufficient performance; (5.2) Divide the training set and test set; The performance sufficient model and performance insufficient model obtained in step (5.1) are divided into training set D train and the test set D test ; The training set D train Take 90% of l0 and 90% of l1 respectively, test set D test Take the remaining 10% of l0 and the remaining 10% of l1; (5.3) Construct a loss function based on time series features, using the training set D in step (5.2) train Train the classifier to obtain a performance prediction classifier; Customize the hyperparameters of the training classifier: number of training rounds, number of batch samples, gradient update rule; the loss function formula of the training classifier is as follows: Where ω is the weight parameter of the classifier; l i Indicates the optimal performance of model training, taking l0 or l1; is the predicted probability value of the model performance in the training iteration; until the classifier training loss function converges, a trained performance prediction classifier is obtained; (5.4) The performance prediction classifier obtained by training in step (5.3) is used for model performance prediction; The performance prediction classifier uses precision as the evaluation index of prediction performance; the test set D obtained in step (5.2) test Input into the performance prediction classifier to complete the model performance prediction.
2. The model performance reasoning method based on dynamic timing diagram according to claim 1 is characterized in that: The data set is a data set including Cifar10, Cifar100 or Mnist; the seed model is a deep learning model including Lenet5, VGG, and Resnet.
3. The model performance reasoning method based on dynamic timing diagram according to claim 1 is characterized in that: The seed model construction is specifically as follows: changing the learning rate and random inactivation rate of the seed model training to generate a sufficient number of seed models Where lr_n and drop_n represent the number of different learning rates and different random dropout rates, respectively.
4. The model performance reasoning method based on dynamic timing diagram according to claim 1 is characterized in that: The training seed model is specifically: set up is a neural network at a learning rate lr i and dropout rate drop j Under this condition, the model set obtained by training iterations T times; each Represents the checkpoint saved at training time t, that is, the weight parameter θ of the model at time t; each model set The training loss function is: Where x represents the image sample participating in the training, y represents the true label corresponding to the x sample, lr represents the learning rate set by the model set, drop represents the random inactivation rate set by the model set, θ represents the weight parameter that the model needs to update, class_n represents the number of categories of the classification task, and yi represents the true distribution of sample x in category i. Represents the predicted distribution of sample x in category i.
5. The model performance reasoning method based on dynamic timing diagram according to claim 1 is characterized in that: The step (3) is specifically: picture The calculation formula of the eigenvector centrality is as follows: Among them, A is the graph The adjacency matrix of -1 is the eigenvalue of matrix A; α is a vector used to measure the importance of each node in the graph, and is assigned to after reaching a steady state after multiple iterations. The length of is the number of nodes in the graph; repeat the above formula until the time evolution graph The corresponding eigenvector centrality is calculated The time evolution graph set G is calculated 6. The model performance reasoning method based on dynamic timing diagram according to claim 1 is characterized in that: The step (4) specifically includes the following sub-steps: (4.1) The graph at training time t in the time evolution graph obtained in step (2) is called the time static graph, and the statistical features of the static graph are calculated: For each time static graph, five statistical features are introduced: mean, standard deviation, median, skewness and kurtosis; the formula is as follows: med(x)=median(x) Among them, x represents the graph The eigenvector centrality of n represents The length of the vector, i represents the index of the vector, represents the mean of the vector, and σ represents the variance of the vector; that is, the calculation results are Static statistical characteristics of (4.2) Strengthening the static statistical characteristics of the graph Redefine Among them, α is a constant, which indicates the influence of the feature at the previous moment on the current feature. If α = 1, there is no influence; (4.3) Aggregate the static statistical features at each moment after strengthening in step (4.2) to form time series features; (4.4) Repeat the above steps (4.1) to (4.3) until the time evolution diagram The eigenvector centrality of Calculate the time series characteristics EC is calculated 7. A model performance reasoning device based on a dynamic timing diagram, characterized in that: It includes one or more processors for implementing the model performance reasoning method based on dynamic timing diagram described in any one of claims 1-6.
8. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, it is used to implement the model performance reasoning method based on a dynamic timing diagram as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Distributed decision making supporting massive high-concurrency access I / O (Input / output) server load balancing system
CN103188346A
Dynamic neutral network model training method based on ensemble learning and dynamic neutral network model training device thereof
CN107480774A