Uncertainty estimation method for neural network model and related equipment

By replacing the original model parameters with spike and slab distribution and training the unknown parameters, random sampling is used to estimate the uncertainty of the neural network model, which solves the problem of low efficiency in the existing technology and achieves efficient uncertainty estimation and accurate prediction.

CN116307216BActive Publication Date: 2025-09-16PENG CHENG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310299415.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2025-09-16
Estimated Expiration
2043-03-24

AI Technical Summary

Technical Problem

The uncertainty estimation efficiency of neural network models in existing technologies is low, especially for deep neural network models. The Markov chain Monte Carlo method requires a large amount of parameter sampling and is not applicable.

Method used

The original model parameters in the preset model to be trained are replaced with spike and slab distribution, and the preset neural network model is obtained by training the undetermined parameters. Random sampling is used for uncertainty estimation to avoid the tedious steps of parameter sampling.

Benefits of technology

The uncertainty estimation efficiency of the neural network model is improved, the parameter sampling process is simplified, and the uncertainty prediction accuracy of the model is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116307216B_ABST
    Figure CN116307216B_ABST
Patent Text Reader

Abstract

The present application discloses a method for estimating uncertainty of a neural network model and related equipment, belonging to the field of data processing. The present application inputs data to be analyzed, performs prediction processing on the data to be analyzed based on a preset neural network model, and obtains analysis results of the data to be analyzed, wherein the analysis results include predicted values ​​of the data to be analyzed and uncertainty estimates of the preset neural network model; the preset neural network model is obtained by training undetermined parameters of target model parameters in a preset model to be trained, and the target model parameters are obtained by replacing original model parameters in the preset model to be trained with spike and slab distributions from point values; the analysis results are obtained by randomly sampling the target model parameters in the preset neural network model obtained after training, and predicting the data to be analyzed based on the target neural network model obtained by random sampling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method for estimating uncertainty of a neural network model and related equipment. Background Art

[0002] Neural network models are used in various fields. For fields such as weather forecasting, medical treatment, and autonomous driving, serious sample prediction errors can lead to significant losses. By improving the accuracy of uncertainty estimation of neural network models, it is possible to avoid reducing the error of model prediction. Therefore, when using neural network models for sample prediction, it is particularly important to estimate the uncertainty of the model.

[0003] Currently, the typical approach to estimating model uncertainty is to use the Markov Chain Monte Carlo method. This method assumes a known probability distribution and repeatedly randomly samples the parameter space to obtain the posterior distribution of the model parameters. This method then uses the posterior distribution of the model parameters as the basis for the uncertainty estimation. This method requires a large amount of parameter sampling and is not suitable for models with a large number of parameters, such as deep neural networks. This results in low efficiency in estimating uncertainty in neural network models.

[0004] Therefore, there is a problem in the related art of low efficiency in uncertainty estimation of neural network models. Summary of the Invention

[0005] The main purpose of this application is to provide a method for estimating uncertainty of a neural network model and related equipment, aiming to solve the technical problem of low efficiency in estimating uncertainty of a neural network model.

[0006] To achieve the above objectives, the present application provides a method for estimating uncertainty of a neural network model, the method comprising the following steps:

[0007] Inputting data to be analyzed, performing prediction processing on the data to be analyzed based on a preset neural network model, and obtaining an analysis result of the data to be analyzed, wherein the analysis result includes a predicted value of the data to be analyzed and an uncertainty estimate of the preset neural network model;

[0008] In which, the preset neural network model is obtained by training the pending parameters of the target model parameters in the preset model to be trained, the target model parameters are obtained by replacing the original model parameters in the preset model to be trained with spike and slab distributions, and the spike and slab distribution is defined by multiple pending parameters, and the analysis results are obtained by randomly sampling the target model parameters in the preset neural network model obtained after training, and predicting the data to be analyzed based on the target neural network model obtained by random sampling.

[0009] In a possible implementation of the present application, before the step of inputting the data to be analyzed, performing prediction processing on the data to be analyzed based on a preset neural network model, and obtaining an analysis result of the data to be analyzed, the method further includes:

[0010] Replacing original model parameters in the preset to-be-trained model from point values ​​to spike and slab distribution to obtain target model parameters, wherein the spike and slab distribution includes a plurality of to-be-determined parameters;

[0011] Wherein, the expression of the target model parameter is:

[0012]

[0013] in, is the spike distribution, The mean is , the variance is

[0014] slab distribution, is the i*k matrix of the original model parameters, 、 、 and is the undetermined parameter, i and k are the row elements and column elements of the matrix respectively, and l is the neural network level of the preset model to be trained;

[0015] Based on the preset training samples with predicted value labels, the undetermined parameters in the preset model to be trained are trained to obtain the preset neural network model that meets the accuracy conditions.

[0016] In a possible implementation of the present application, the step of training the undetermined parameters in the preset to-be-trained model based on the preset training samples with predicted value labels to obtain the preset neural network model that meets the accuracy conditions includes:

[0017] Preprocessing the preset training samples to obtain the data to be analyzed;

[0018] Inputting the data to be analyzed into the preset model to be trained, converting the data to be analyzed into target data to be analyzed that approximately obeys a Gaussian distribution based on multiple neural network layers of the preset model to be trained, and performing calculations on the target data to be analyzed to obtain analysis results of the target data to be analyzed;

[0019] Calculating the error between the analysis result and the predicted value label based on a gradient descent method to obtain an error calculation result;

[0020] Based on the error calculation result, the undetermined parameters in the linear model to be trained are updated, and the process returns to the step of preprocessing the preset training samples to obtain the data to be analyzed, until a neural network model that meets the accuracy conditions is obtained.

[0021] In a possible implementation of the present application, the step of converting the data to be analyzed into target data to be analyzed that approximately obeys a Gaussian distribution based on the multiple neural network layers of the preset model to be trained includes:

[0022] Based on the undetermined parameters, first-order moments and second-order moments of the target model parameters are calculated;

[0023] The calculation formulas for the first-order moment and the second-order moment are respectively:

[0024]

[0025]

[0026] Assuming that the target data to be analyzed approximately obeys a Gaussian distribution, and calculating the mean and variance of the Gaussian distribution based on the first-order moment and second-order moment of the target model parameters;

[0027] The calculation formulas for the mean and variance of the Gaussian distribution are:

[0028]

[0029]

[0030] in, is the preset training sample after vectorization processing, the For the -1 layer neural network the number of elements in the vector;

[0031] Calculating the target data to be analyzed that approximately obeys the Gaussian distribution based on the preset training samples after the vectorization processing and the mean and variance of the Gaussian distribution;

[0032] The target data to be analyzed is expressed as follows:

[0033]

[0034] Among them, the is a random variable that follows a standard normal distribution.

[0035] In a possible implementation of the present application, the step of inputting the data to be analyzed, performing prediction processing on the data to be analyzed based on a preset neural network model, and obtaining an analysis result of the data to be analyzed includes:

[0036] Randomly sampling the random variables that obey the standard normal distribution, inputting the target data to be analyzed obtained by random sampling into the preset model to be trained, and performing calculations on the target data to be analyzed based on the preset model to be trained to obtain analysis results of the target data to be analyzed;

[0037] The step of calculating the error between the analysis result and the predicted value label based on the gradient descent method to obtain the error calculation result includes:

[0038] Calculating the error between the analysis result and the predicted value label based on a preset gradient descent calculation formula to obtain an error calculation result;

[0039] Among them, the preset gradient descent calculation formula is:

[0040]

[0041] in, The undetermined parameters 、 、 and A collection of is the learning rate of the preset model to be trained, is the original loss function of the preset model to be trained.

[0042] In a possible implementation of the present application, after the step of updating the undetermined parameters in the linear model to be trained based on the error calculation result and returning to the step of preprocessing the preset training samples to obtain the data to be analyzed until a neural network model that meets the accuracy condition is obtained, the method further includes:

[0043] Based on the spike and slab distribution, randomly sampling target model parameters in the neural network model that meets the accuracy condition to obtain multiple target neural network models;

[0044] Testing the target neural network model based on a test sample pre-divided from the preset training sample to obtain a target prediction value of the preset test sample;

[0045] The mean of the target prediction values ​​is used as the prediction value of the test sample, and the standard deviation of the target prediction value is used as the uncertainty estimate of the neural network model that meets the accuracy condition.

[0046] In a possible implementation of the present application, before the step of randomly sampling target model parameters in the neural network model that meets the accuracy condition based on the spike and slab distribution to obtain multiple target neural network models, the method further includes:

[0047] If the weight of the spike distribution of the target model parameter in the neural network model that meets the accuracy condition is close to 1 and the spike centroid is close to 0, the neural network model that meets the accuracy condition is not tested.

[0048] The present application also provides an uncertainty estimation device for a neural network model, the device comprising:

[0049] An uncertainty assessment module is used to input data to be analyzed, perform predictive processing on the data to be analyzed based on a preset neural network model, and obtain analysis results of the data to be analyzed, wherein the analysis results include the predicted value of the data to be analyzed and the uncertainty estimate of the preset neural network model, wherein the preset neural network model is obtained by training the target model parameters in the preset model to be trained, and the target model parameters are obtained by replacing the original model parameters in the preset model to be trained with spike and slab distribution from point values, and the analysis results are obtained by randomly sampling the target model parameters in the preset neural network model obtained after training, and predicting the data to be analyzed based on the target neural network model obtained by random sampling.

[0050] The present application also provides an uncertainty estimation device for a neural network model, the device comprising: a memory, a processor, and an uncertainty estimation program for a neural network model stored on the memory and executable on the processor, the uncertainty estimation program for the neural network model being configured to implement the steps of the uncertainty estimation method for a neural network model as described in any one of the above items.

[0051] The present application also provides a storage medium on which a program for estimating the uncertainty of a neural network model is stored. When the program for estimating the uncertainty of a neural network model is executed by a processor, the steps of the method for estimating the uncertainty of a neural network model as described in any one of the above items are implemented.

[0052] The present application provides a method for estimating uncertainty of a neural network model. Compared with the prior art method of using the Markov chain Monte Carlo method to estimate the uncertainty of the model, a large amount of parameter sampling is required. This method is not applicable to models such as deep neural networks that contain a large number of parameters, resulting in low efficiency in estimating the uncertainty of the neural network model. The present application inputs data to be analyzed, performs prediction processing on the data to be analyzed based on a preset neural network model, and obtains an analysis result of the data to be analyzed, wherein the analysis result includes a predicted value of the data to be analyzed and an uncertainty estimate of the preset neural network model; wherein the preset neural network model is obtained by training the undetermined parameters of the target model parameters in the preset training model, the target model parameters are obtained by replacing the original model parameters in the preset training model with point values ​​with a spike and slab distribution (a weighted sum of a Dirac distribution and a Gaussian distribution), the spike and slab distribution being defined by multiple undetermined parameters, and the analysis result is obtained by randomly sampling the target model parameters in the trained preset neural network model, and predicting the data to be analyzed based on the target neural network model obtained by random sampling.

[0053] That is to say, the present application replaces the original model parameters in the preset model to be trained by point values ​​with spike and slab distribution to obtain target model parameters, and the spike and slab distribution is defined by multiple pending parameters. There is no need to perform a large amount of parameter sampling to obtain the posterior distribution of the model parameters, but directly replaces the original model parameters by point values ​​with spike and slab distribution, thereby avoiding the tedious steps of parameter sampling. The preset neural network model is obtained after training the pending parameters of the target model parameters in the preset model to be trained, and then the target model parameters in the preset neural network model are randomly sampled. The target neural network model obtained by random sampling predicts the data to be analyzed to obtain the predicted value of the data to be analyzed and the uncertainty estimate of the preset neural network model. The target neural network model obtained by random sampling can be used to estimate the model uncertainty. Therefore, the present application can improve the efficiency of uncertainty estimation of the neural network model. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1This is a flow chart of a first embodiment of a method for estimating uncertainty of a neural network model according to the present application;

[0055] Figure 2 It is a structural diagram of an uncertainty estimation device for a neural network model in a hardware operating environment involved in an embodiment of the present application;

[0056] Figure 3 Schematic diagram of the uncertainty estimation device of the neural network model according to the first embodiment of the present application.

[0057] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0058] It should be understood that the specific embodiments described herein are intended only to explain the present application and are not intended to limit the present application. Although terms such as first, second, and third may be used herein to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information.

[0059] The present invention provides a method for estimating uncertainty of a neural network model. Figure 1 In this embodiment, the uncertainty estimation method of the neural network model includes:

[0060] Step S10: input the data to be analyzed, perform prediction processing on the data to be analyzed based on a preset neural network model, and obtain an analysis result of the data to be analyzed, wherein the analysis result includes the predicted value of the data to be analyzed and the uncertainty estimate of the preset neural network model, wherein the preset neural network model is obtained by training the pending parameters of the target model parameters in the preset model to be trained, and the target model parameters are obtained by replacing the original model parameters in the preset model to be trained with point values ​​to spike and slab distribution, and the spike and slab distribution is defined by multiple pending parameters, and the analysis result is obtained by randomly sampling the target model parameters in the preset neural network model obtained after training, and predicting the data to be analyzed based on the target neural network model obtained by random sampling.

[0061] As an example, the uncertainty estimation method of the neural network model is applied to the uncertainty estimation device of the neural network model, and the uncertainty estimation device of the neural network model is subordinate to the uncertainty estimation device of the neural network model.

[0062] As an example, the data to be analyzed may be traveling salesman problem data, weather data, driving condition data, etc.

[0063] As an example, the preset neural network model can be a model that analyzes and processes the traveling salesman problem data to obtain a traveling salesman solution, a model that performs forecasting and processing based on meteorological data to predict weather changes, or a model that analyzes and processes driving condition data to obtain a driving plan, etc.

[0064] As an example, the analysis results of the data to be analyzed can be a traveling salesman solution and an uncertainty estimate of the corresponding preset neural network model, a weather forecast and an uncertainty estimate of the corresponding preset neural network model, a driving plan and an uncertainty estimate of the corresponding preset neural network model, etc., which are not limited here.

[0065] As an example, since the above-mentioned relatively complex data to be analyzed needs to be predicted and processed, the preset neural network model needs to include a large number of model parameters in order to improve the accuracy of the prediction.

[0066] However, when using neural network models for sample prediction, it is also particularly important to estimate the uncertainty of the model. Currently, the typical method is to use the Markov Chain Monte Carlo method to estimate the uncertainty of the model. This method requires assuming that the probability distribution is known and obtains the posterior distribution of the model parameters by repeated random sampling of the parameter space. Based on the posterior distribution of the model parameters, the method is used to estimate the uncertainty of the model. This method requires a large amount of parameter sampling and is not suitable for models with a large number of parameters such as deep neural networks, resulting in low efficiency in estimating the uncertainty of neural network models.

[0067] This embodiment aims to obtain a preset neural network model by replacing original model parameters in a preset to-be-trained model with spike-and-slab distributions instead of point values, and training multiple undetermined parameters in the spike-and-slab distributions. The preset neural network model is then used to predict the data to be analyzed, thereby obtaining a predicted value of the data to be analyzed and an uncertainty estimate of the preset neural network model. This avoids the tedious step of parameter sampling, thereby improving the efficiency of uncertainty estimation for the neural network model.

[0068] The specific steps are as follows:

[0069] Step S10: inputting data to be analyzed, performing prediction processing on the data to be analyzed based on a preset neural network model, and obtaining an analysis result of the data to be analyzed, wherein the analysis result includes a predicted value of the data to be analyzed and an uncertainty estimate of the preset neural network model;

[0070] In this embodiment, the preset neural network model is obtained by training the pending parameters of the target model parameters in the preset model to be trained, and the target model parameters are obtained by replacing the original model parameters in the preset model to be trained with spike and slab distributions, and the spike and slab distribution is defined by multiple pending parameters. The analysis result is obtained by randomly sampling the target model parameters in the preset neural network model obtained after training, and predicting the data to be analyzed based on the target neural network model obtained by random sampling.

[0071] For ease of description, this embodiment uses the Traveling Salesman Problem (TSP) as an example. The TSP is a classic combinatorial optimization problem. It can be described as follows: a salesperson travels to several cities to sell goods. Starting from one city, the salesperson must travel through all the cities before returning to their starting point. How should the salesperson choose a route that minimizes the total distance? The TSP data can be a list (problem) s consisting of n nodes (cities). Specifically, the predicted value corresponding to the TSP data is a specific permutation of these n nodes.

[0072] For example, while current neural network-based solvers for the traveling salesman problem perform well on small scales, the gap between their predictions and the optimal solution widens as the scale increases. Therefore, for problems like these that are highly sensitive to order, understanding the uncertainty of the neural network model is crucial for developing subsequent strategies.

[0073] In this embodiment, in order to avoid the tedious step of obtaining the posterior distribution of model parameters in the preset neural network model through parameter sampling, the original model parameters in the preset model to be trained are replaced by point values ​​into a spike and slab distribution, and the spike and slab distribution is defined by multiple parameters to be determined. Without performing parameter sampling, the spike and slab distribution form of the model parameters in the preset neural network model can be obtained, and on this basis, prediction of the data to be analyzed can also be achieved.

[0074] Specifically, a preset neural network model is obtained by training the undetermined parameters of the target model parameters in the preset to-be-trained model, and then the target model parameters in the preset neural network model are randomly sampled. The target neural network model obtained by random sampling is used to predict the data to be analyzed to obtain a predicted value of the data to be analyzed and an uncertainty estimate of the preset neural network model. The target neural network model obtained by random sampling can be used to estimate model uncertainty.

[0075] In this embodiment, before the step of inputting the data to be analyzed, performing prediction processing on the data to be analyzed based on a preset neural network model, and obtaining an analysis result of the data to be analyzed, the method further includes:

[0076] Step S20: replacing original model parameters in the preset to-be-trained model from point values ​​to spike and slab distribution to obtain target model parameters, wherein the spike and slab distribution includes a plurality of to-be-determined parameters;

[0077] In this embodiment, the expression of the target model parameter is:

[0078]

[0079] In this embodiment, is the spike distribution, The mean is , the variance is slab distribution, is the i*k matrix of the original model parameters, 、 、 and is the undetermined parameter, i and k are the row elements and column elements of the matrix respectively, and l is the neural network level of the preset model to be trained.

[0080] As an example, the original model parameters in the preset model to be trained are Replaced with spike and slab distribution, specifically, the original model parameters in the preset training model are matrixed to obtain the i*k matrix of the original model parameters, where i and k are the row elements and column elements of the matrix respectively; the expression of spike distribution is , the expression of slab distribution is , the weighted sum of the spike distribution and the slab distribution is the distribution form of the target model parameters.

[0081] As an example, the original model parameters in the preset model to be trained exist in the form of point values. That is, after the preset model to be trained is completed, the model parameters of the neural network model obtained are specific numerical values. However, after the original model parameters in the preset model to be trained are replaced from point values ​​to spike and slab distribution, the target model parameters of the neural network model obtained exist in the form of spike and slab distribution rather than specific numerical values.

[0082] Step S30: Based on the preset training samples with prediction value labels, the undetermined parameters in the preset to-be-trained model are trained to obtain the preset neural network model that meets the accuracy conditions.

[0083] As an example, a traveling salesman problem sample with the specific arrangement labels of the above n nodes is obtained, and based on the preset traveling salesman problem sample with the specific arrangement labels of the above n nodes, the undetermined parameters in the preset traveling salesman problem solving model to be trained are trained to obtain a traveling salesman problem solving model that meets the accuracy conditions.

[0084] As an example, based on the TSP sample with the specific arrangement labels of the n nodes, the undetermined parameters in the TSP solution model to be trained are trained, that is, the undetermined parameters of the target model parameters in the preset TSP solution model to be trained ( 、 、 and ) are trained respectively to obtain the traveling salesman problem solving model that meets the accuracy conditions, wherein the target model parameters of the trained traveling salesman problem solving model are the target model parameters determined after training. 、 、 and The spike and slab distribution defined by the same specific value can improve the uncertainty prediction accuracy of the traveling salesman problem solution model.

[0085] In this embodiment, the original model parameters in the preset model to be trained are replaced by point values ​​with spike and slab distribution to obtain target model parameters, and the spike and slab distribution is defined by multiple pending parameters. It is not necessary to perform a large amount of parameter sampling to obtain the posterior distribution of the model parameters, but directly replace the original model parameters with spike and slab distribution from point values, thereby avoiding the tedious steps of parameter sampling. The preset neural network model is obtained by training the pending parameters of the target model parameters in the preset model to be trained, and then the target model parameters in the preset neural network model are randomly sampled. The data to be analyzed is predicted based on the target neural network model obtained by random sampling to obtain the predicted value of the data to be analyzed and the uncertainty estimate of the preset neural network model. The target neural network model obtained by random sampling can be used to estimate the model uncertainty. Therefore, the present application can improve the efficiency of uncertainty estimation of the neural network model. Furthermore, the original model parameters in the preset model to be trained are replaced by point values ​​with spike and slab distribution to obtain target model parameters. Based on the preset training samples with predicted value labels, the undetermined parameters in the preset model to be trained are trained to obtain the preset neural network model that meets the accuracy conditions, which can improve the uncertainty prediction accuracy of the model.

[0086] Furthermore, based on the above embodiment of the present application, another embodiment of the present application is provided. In this embodiment, the step of training the undetermined parameters in the preset to-be-trained model based on the preset training samples with predicted value labels to obtain the preset neural network model that meets the accuracy conditions includes:

[0087] Step A1: pre-processing the preset training samples to obtain the data to be analyzed;

[0088] As an example, the traveling salesman problem solving model can be a traveling salesman problem solving model based on the attention mechanism, or a traveling salesman problem solving model based on the PPO algorithm, etc., which is not limited here.

[0089] In this embodiment, for the convenience of description, a traveling salesman problem solving model based on an attention mechanism is taken as an example for specific explanation.

[0090] As an example, preprocessing the preset training samples to obtain the data to be analyzed can be performing vectorization processing on the traveling salesman problem samples or converting discrete variables (traveling salesman problem samples) into continuous variables (data to be analyzed) to obtain the traveling salesman problem data.

[0091] As an example, the predicted value corresponding to the traveling salesman problem data is a specific arrangement of these n nodes ,in, ,and .

[0092] Step A2: inputting the data to be analyzed into the preset model to be trained, converting the data to be analyzed into target data to be analyzed that approximately obeys a Gaussian distribution based on multiple neural network layers of the preset model to be trained, and performing calculations on the target data to be analyzed to obtain analysis results of the target data to be analyzed;

[0093] As an example, inputting the preset training samples into the preset model to be trained may be inputting the traveling salesman problem samples into a preset traveling salesman problem solving model based on an attention mechanism to be trained.

[0094] As an example, the traveling salesman problem solving model based on the attention mechanism to be trained is given an example , define a random strategy To select the corresponding predicted value The model is defined by a series of model parameters. Specifically, the random strategy The expression is:

[0095]

[0096] in, The predicted value order.

[0097] As an example, the traveling salesman problem solving model based on the attention mechanism to be trained includes an encoder and a decoder, and the encoder is composed of multiple layers of neural network layers, and each layer of the neural network layer includes a linear fully connected layer and a multi-head attention layer.

[0098] As an example, in the original attention-based traveling salesman problem model to be trained, the encoder first passes the relation To calculate the initial embedding of each node (embedding value, that is, the data to be analyzed at the first layer of the neural network layer), that is, to convert discrete variables into continuous variables. and are the parameters of the linear fully connected layer, Represents the coordinates of the corresponding node, and the embedding is updated through multiple multi-head attention layers, where the first The node embedding generated by the multi-head attention layer calculation ( The data to be analyzed at the neural network level is:

[0099]

[0100] in, ;

[0101] ;

[0102] ;

[0103] .

[0104] Among them, BN is batch normalization (which ensures that the distribution of the input / output data of the multiple neural network layers does not change significantly during data processing even if the parameters change, thereby avoiding the internal covariate shift phenomenon), MHA refers to the multi-head attention layer (which uses different transformations to transform queries, keys, and values ​​into different values, calculates attention using the transformed queries, keys, and values, splices the outputs of multiple attentions together, and transforms them through a linear fully connected layer to produce the final output). and They are query, key and value respectively. for or The dimension of .

[0105] Specifically, and Calculated by the following formula:

[0106]

[0107] in, and All are trainable parameters (part of the parameters to be determined);

[0108] The expression of the linear fully connected layer is:

[0109]

[0110] As an example, in the original attention-based traveling salesman problem model to be trained, the decoder adopts the execution order of the above encoder to decode. , the decoder is based on the node embedding and Output Generate solution The final output probability (i.e., predicted value) of each node in each position in the node sorting is:

[0111]

[0112] in,

[0113]

[0114] in, and They are the query of the context node and the key value of each node. for or The dimension of .

[0115] As an example, based on the multiple neural network layers of the preset model to be trained, the data to be analyzed are converted into target data to be analyzed that approximately obeys a Gaussian distribution. The business travel problem data can be converted into target business travel problem data that approximately obeys a Gaussian distribution based on an attention mechanism.

[0116] In this embodiment, the step of converting the data to be analyzed into target data to be analyzed that approximately obeys a Gaussian distribution based on the multiple neural network layers of the preset model to be trained includes:

[0117] Step B1: Based on the undetermined parameters, calculate the first-order moment and the second-order moment of the target model parameters;

[0118] The calculation formulas for the first-order moment and the second-order moment are respectively:

[0119]

[0120]

[0121] As an example, is the i*k matrix of the original model parameters. Specifically, the i*k matrix contains all the original model parameters in the preset model to be trained (for example, the original model parameters in the traveling salesman problem solution model based on the attention mechanism to be trained). , , , and Waiting for parameters to be set).

[0122] Step B2: Assuming that the target data to be analyzed approximately obeys a Gaussian distribution, and based on the first-order moment and second-order moment of the target model parameters, calculating the mean and variance of the Gaussian distribution;

[0123] The calculation formulas for the mean and variance of the Gaussian distribution are:

[0124]

[0125]

[0126] in, is the preset training sample after vectorization processing, the For the -1 layer neural network the number of elements in the vector;

[0127] As an example, for large-scale model parameters, the central limit theorem shows that pre-activation approximately follows a Gaussian distribution. Since the data to be analyzed is based on the , obtained by preprocessing the preset training samples, and then After replacing it with spike and slab distribution, it can be assumed that the target data to be analyzed approximately obeys Gaussian distribution , and the mean and variance of the Gaussian distribution can be calculated based on the first-order moment and the second-order moment of the target model parameters.

[0128] Step B3: Calculating the target data to be analyzed that approximately obeys the Gaussian distribution based on the preset training samples after the vectorization process and the mean and variance of the Gaussian distribution;

[0129] The target data to be analyzed is expressed as follows:

[0130]

[0131] Among them, the is a random variable that follows a standard normal distribution.

[0132] Step A3: Calculating the error between the analysis result and the predicted value label based on the gradient descent method to obtain an error calculation result;

[0133] As an example, different preset training models use different loss functions for model convergence. For example, the loss function used by the original attention-based traveling salesman problem solving model to be trained is:

[0134]

[0135] in, is the path length;

[0136] As an example, the gradient descent formula used by the original attention-based traveling salesman problem model to be trained is:

[0137]

[0138] In this embodiment, the step of inputting the data to be analyzed, performing prediction processing on the data to be analyzed based on a preset neural network model, and obtaining an analysis result of the data to be analyzed includes:

[0139] Step C1: randomly sampling the random variables that obey the standard normal distribution, inputting the target data to be analyzed obtained by random sampling into the preset model to be trained, and performing calculations on the target data to be analyzed based on the preset model to be trained to obtain analysis results of the target data to be analyzed;

[0140] As an example, when calculating the target data to be analyzed, Random sampling to obtain multiple , and for the multiple (target data to be analyzed) are calculated respectively to obtain analysis results of the target data to be analyzed.

[0141] In this embodiment, the step of calculating the error between the analysis result and the predicted value label based on the gradient descent method to obtain the error calculation result includes:

[0142] Step D1: Calculate the error between the analysis result and the predicted value label based on a preset gradient descent calculation formula to obtain an error calculation result;

[0143] As an example, after parameter replacement (the original model parameters in the preset model to be trained are replaced from point values ​​to spike and slab distributions), during the training process, a preset gradient descent calculation formula is used to calculate the error between the analysis result and the predicted value label to obtain an error calculation result.

[0144] Among them, the preset gradient descent calculation formula is:

[0145]

[0146] in, The undetermined parameters 、 、 and A collection of is the learning rate of the preset model to be trained, is the original loss function of the preset model to be trained.

[0147] As an example, traditional variational inference methods usually use variational free energy as the loss function. However, since the model parameters in the preset model to be trained after parameter replacement are all spike and slab distributed, it is difficult to calculate the variational free energy. Therefore, directly optimizing the original loss function of the preset model to be trained simplifies the modification of the preset model to be trained and the calculation of the loss function.

[0148] It should be noted that the weight of spike distribution during training Need to be limited to , the variance in the slab distribution Need to be limited to .

[0149] Step A4: Based on the error calculation result, update the undetermined parameters in the linear model to be trained, and return to the step of preprocessing the preset training samples to obtain the data to be analyzed, until a neural network model that meets the accuracy conditions is obtained.

[0150] As an example, if the error calculation result does not meet the preset error threshold, the undetermined parameters in the linear model to be trained are updated. , and returns to the step of preprocessing the preset training samples to obtain the data to be analyzed, until a neural network model that meets the accuracy conditions is obtained.

[0151] In this embodiment, the above method can obtain the preset neural network model that meets the accuracy conditions, and the target model parameters in the preset neural network model are spike and slab distributions. It is possible to estimate the uncertainty of the model by the target neural network model obtained by random sampling, and there is no need to change the loss function of the original model to be trained. Compared with the usual variational inference method for estimating the uncertainty of the model, the parameters to be determined of the specific distribution are obtained by training to minimize the expected lower bound of the variational free energy or marginal likelihood. For the posterior distribution of the parameters, the uncorrelated Gaussian distribution, the sum of the double Gaussian distribution, and the introduction of the correlation and normalization flow between the parameters on the basis of the Gaussian distribution are usually selected. For more complex or certain specific forms of prior and posterior distributions, the expected lower bound of the variational free energy or marginal likelihood is usually difficult to calculate. This embodiment directly optimizes the original loss function of the preset model to be trained, which simplifies the modification of the preset model to be trained and the calculation of the loss function.

[0152] Furthermore, based on the above embodiment of the present application, another embodiment of the present application is provided. In this embodiment, after updating the undetermined parameters in the linear model to be trained based on the error calculation result and returning to the step of preprocessing the preset training samples to obtain the data to be analyzed until a neural network model that meets the accuracy condition is obtained, the method further includes:

[0153] Step S40: Based on the spike and slab distribution, randomly sampling the target model parameters in the neural network model that meets the accuracy condition to obtain multiple target neural network models;

[0154] Step S50: testing the target neural network model based on the test samples pre-divided from the preset training samples to obtain the target prediction value of the preset test samples;

[0155] Step S60: taking the mean of the target prediction values ​​as the prediction value of the test sample, and taking the standard deviation of the target prediction values ​​as the uncertainty estimate of the neural network model that meets the accuracy condition.

[0156] As an example, based on the spike and slab distribution, the target model parameters in the neural network model that meets the accuracy conditions are randomly sampled to obtain α target neural network models. Based on the test samples pre-divided from the preset training samples, the α target neural network models are tested separately to obtain α target prediction values ​​of the preset test samples. The mean of the α target prediction values ​​is used as the prediction value of the test sample, and the standard deviation of the α target prediction values ​​is used as the uncertainty estimate of the neural network model that meets the accuracy conditions, so as to achieve reasonable uncertainty estimation of the model without changing the prediction accuracy of the model.

[0157] In this embodiment, before the step of randomly sampling the target model parameters in the neural network model that meets the accuracy condition based on the spike and slab distribution to obtain multiple target neural network models, the method further includes:

[0158] Step E1: If the weight of the spike distribution of the target model parameter in the neural network model that meets the accuracy condition is close to 1, and the spike centroid is close to 0, the neural network model that meets the accuracy condition is not tested.

[0159] As an example, in order to effectively and concisely compress model parameters, if the weight of the spike distribution of the target model parameters in the neural network model that meets the accuracy conditions is close to 1, and the spike centroid is close to 0, then it is considered that the target model parameters have no contribution to the predicted value and uncertainty of the model. Therefore, the neural network model in which the weight of the spike distribution of the target model parameters is close to 1 and the spike centroid is close to 0 is not tested, that is, the purpose of effectively compressing the scale of the neural network model parameters is achieved without changing the prediction accuracy of the neural network model.

[0160] In this embodiment, the mean of the α target prediction values ​​is used as the prediction value of the test sample, and the standard deviation of the α target prediction values ​​is used as the uncertainty estimate of the neural network model that meets the accuracy conditions, so as to achieve a reasonable uncertainty estimate of the model without changing the prediction accuracy of the model. Compared with the dropout technology, it is necessary to randomly discard a part of the connections with a certain probability during training. After the training is completed, the dropout is also turned on during the test, and the mean and standard deviation of multiple predictions are used as the prediction value and uncertainty estimate of the model. For the above-mentioned traveling salesman problem, the prediction accuracy of the model will be greatly lost. In this embodiment, if the weight of the spike distribution of the target model parameter in the neural network model that meets the accuracy conditions is close to 1, and the spike centroid is close to 0, the neural network model is not tested, that is, the purpose of effectively compressing the parameter scale of the neural network model is achieved, and the prediction accuracy of the neural network model is not changed.

[0161] Reference Figure 2 , Figure 2 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0162] like Figure 2 As shown, the uncertainty estimation device of the neural network model may include: a processor 1001, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005.

[0163] Optionally, the neural network model uncertainty estimation device may further include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, a WiFi module, and the like. The user interface may include a display and an input submodule such as a keyboard. The optional user interface may also include a standard wired interface or a wireless interface. The network interface may include a standard wired interface or a wireless interface (such as a WiFi interface).

[0164] Those skilled in the art will understand that Figure 2 The uncertainty estimation device structure of the neural network model shown in does not constitute a limitation on the uncertainty estimation device of the neural network model, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0165] like Figure 2 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, and a neural network model uncertainty estimation program. The operating system is a program that manages and controls the hardware and software resources of the neural network model uncertainty estimation device, and supports the operation of the neural network model uncertainty estimation program and other software and / or programs. The network communication module is used to implement communication between the various components within the memory 1005, as well as communication with other hardware and software in the neural network model uncertainty estimation system.

[0166] exist Figure 2 In the uncertainty estimation device of the neural network model shown, the processor 1001 is used to execute the uncertainty estimation program of the neural network model stored in the memory 1005 to implement the steps of the uncertainty estimation method of the neural network model described in any one of the above items.

[0167] The specific implementation of the uncertainty estimation device of the neural network model of the present application is basically the same as the various embodiments of the uncertainty estimation method of the above-mentioned neural network model, and will not be repeated here.

[0168] This application also provides an uncertainty estimation device for a neural network model, such as Figure 3 As shown, the device includes:

[0169] The uncertainty assessment module 10 is used to input data to be analyzed, perform prediction processing on the data to be analyzed based on a preset neural network model, and obtain analysis results of the data to be analyzed, wherein the analysis results include the predicted value of the data to be analyzed and the uncertainty estimate of the preset neural network model, wherein the preset neural network model is obtained by training the target model parameters in the preset model to be trained, and the target model parameters are obtained by replacing the original model parameters in the preset model to be trained with spike and slab distribution from point values, and the analysis results are obtained by randomly sampling the target model parameters in the preset neural network model obtained after training, and predicting the data to be analyzed based on the target neural network model obtained by random sampling.

[0170] Optionally, in a possible implementation manner of the present application, before the step of inputting the data to be analyzed, performing prediction processing on the data to be analyzed based on a preset neural network model, and obtaining an analysis result of the data to be analyzed, the apparatus further includes:

[0171] A parameter replacement module is used to replace the original model parameters in the preset to-be-trained model from point values ​​to spike and slab distribution to obtain target model parameters, wherein the spike and slab distribution includes a plurality of to-be-determined parameters;

[0172] Wherein, the expression of the target model parameter is:

[0173]

[0174] in, is the spike distribution, The mean is , the variance is

[0175] slab distribution, is the i*k matrix of the original model parameters, 、 、 and is the undetermined parameter, i and k are the row elements and column elements of the matrix respectively, and l is the neural network level of the preset model to be trained;

[0176] The model training module is used to train the undetermined parameters in the preset to-be-trained model based on the preset training samples with prediction value labels to obtain the preset neural network model that meets the accuracy conditions.

[0177] Optionally, in a possible implementation of the present application, the model training module includes:

[0178] A preprocessing submodule, configured to preprocess the preset training samples to obtain the data to be analyzed;

[0179] a model analysis submodule, configured to input the data to be analyzed into the preset model to be trained, convert the data to be analyzed into target data to be analyzed that approximately obeys a Gaussian distribution based on multiple neural network layers of the preset model to be trained, and perform calculations on the target data to be analyzed to obtain analysis results of the target data to be analyzed;

[0180] An error calculation submodule, configured to calculate the error between the analysis result and the predicted value label based on a gradient descent method to obtain an error calculation result;

[0181] An iterative training submodule is used to update the undetermined parameters in the linear model to be trained based on the error calculation result, and return to the step of preprocessing the preset training samples to obtain the data to be analyzed until a neural network model that meets the accuracy conditions is obtained.

[0182] Optionally, in a possible implementation of the present application, the model analysis submodule includes:

[0183] A first calculation unit is used to calculate the first-order moment and the second-order moment of the target model parameter based on the undetermined parameter;

[0184] The calculation formulas for the first-order moment and the second-order moment are respectively:

[0185]

[0186]

[0187] A second calculation unit is configured to assume that the target data to be analyzed approximately obeys a Gaussian distribution, and calculate the mean and variance of the Gaussian distribution based on the first-order moment and the second-order moment of the target model parameter;

[0188] The calculation formulas for the mean and variance of the Gaussian distribution are:

[0189]

[0190]

[0191] in, is the preset training sample after vectorization processing, the For the -1 layer neural network the number of elements in the vector;

[0192] A third calculation unit is configured to calculate the target data to be analyzed that approximately obeys the Gaussian distribution based on the preset training samples after the vectorization processing and the mean and variance of the Gaussian distribution;

[0193] The target data to be analyzed is expressed as follows:

[0194]

[0195] Among them, the is a random variable that follows a standard normal distribution.

[0196] Optionally, in a possible implementation of the present application, the uncertainty assessment module 10 includes:

[0197] a variable sampling submodule, configured to randomly sample the random variables obeying the standard normal distribution, input the target data to be analyzed obtained by the random sampling into the preset model to be trained, and perform calculations on the target data to be analyzed based on the preset model to be trained to obtain analysis results of the target data to be analyzed;

[0198] Wherein, the error calculation submodule includes:

[0199] an error calculation unit, configured to calculate the error between the analysis result and the predicted value label based on a preset gradient descent calculation formula to obtain an error calculation result;

[0200] Among them, the preset gradient descent calculation formula is:

[0201]

[0202] in, The undetermined parameters 、 、 and A collection of is the learning rate of the preset model to be trained, is the original loss function of the preset model to be trained.

[0203] Optionally, in a possible implementation manner of the present application, after the step of updating the undetermined parameters in the linear model to be trained based on the error calculation result and returning to the step of preprocessing the preset training samples to obtain the data to be analyzed until the step of obtaining a neural network model that meets the accuracy condition is obtained, the device further includes:

[0204] A parameter sampling module is used to randomly sample target model parameters in the neural network model that meets the accuracy condition based on the spike and slab distribution to obtain multiple target neural network models;

[0205] A testing module, configured to test the target neural network model based on a test sample pre-divided from the preset training sample to obtain a target prediction value of the preset test sample;

[0206] A prediction module is used to use the mean of the target prediction values ​​as the prediction value of the test sample, and use the standard deviation of the target prediction value as the uncertainty estimate of the neural network model that meets the accuracy condition.

[0207] Optionally, in a possible implementation manner of the present application, before the step of randomly sampling target model parameters in the neural network model that meets the accuracy condition based on the spike and slab distribution to obtain multiple target neural network models, the method further includes:

[0208] A model screening module is used to not test the neural network model that meets the accuracy conditions if the weight of the spike distribution of the target model parameter in the neural network model that meets the accuracy conditions is close to 1 and the spike centroid is close to 0.

[0209] The specific implementation of the uncertainty estimation device of the neural network model of the present application is basically the same as the various embodiments of the uncertainty estimation method of the above-mentioned neural network model, and will not be repeated here.

[0210] The present application also provides a storage medium on which a program for estimating the uncertainty of a neural network model is stored. When the program for estimating the uncertainty of a neural network model is executed by a processor, the steps of the method for estimating the uncertainty of a neural network model as described in any one of the above items are implemented.

[0211] The specific implementation of the storage medium of the present application is basically the same as the various embodiments of the uncertainty estimation method of the above-mentioned neural network model, and will not be repeated here.

[0212] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0213] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0214] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0215] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for analyzing the traveling salesman problem, characterized in that: The analysis method of the traveling salesman problem comprises the following steps: Inputting traveling salesman problem data, performing predictive processing on the traveling salesman problem data based on a traveling salesman problem-solving model, and obtaining an analysis result of the traveling salesman problem data, wherein the analysis result includes a traveling salesman solution and an uncertainty estimate of the traveling salesman problem-solving model, the traveling salesman problem data including a list of n cities, and the traveling salesman solution including a specific arrangement of the n cities that minimizes a total itinerary; The traveling salesman problem solving model is obtained by training the pending parameters of the target model parameters in the preset traveling salesman problem solving model to be trained based on preset training samples with traveling salesman solution labels. The target model parameters are obtained by replacing the original model parameters in the preset traveling salesman problem solving model to be trained with spike and slab distributions, and the spike and slab distribution is defined by multiple pending parameters. The analysis results are obtained by randomly sampling the target model parameters in the traveling salesman problem solving model obtained after training, and predicting the traveling salesman problem data based on the target traveling salesman problem solving model obtained by random sampling.

2. The method for analyzing the traveling salesman problem according to claim 1, wherein: Before the step of inputting the traveling salesman problem data, performing prediction processing on the traveling salesman problem data based on the traveling salesman problem solving model, and obtaining an analysis result of the traveling salesman problem data, the method further includes: Replacing original model parameters in the preset traveling salesman problem solving model to be trained with spike and slab distribution from point values ​​to obtain target model parameters, wherein the spike and slab distribution includes a plurality of undetermined parameters; Wherein, the expression of the target model parameter is: in, is the spike distribution, The mean is , the variance is slab distribution, is the i*k matrix of the original model parameters, 、 、 and is the undetermined parameter, i and k are the row elements and column elements of the matrix respectively, and l is the neural network level of the preset traveling salesman problem solving model to be trained; Based on preset training samples with traveling salesman solution labels, undetermined parameters in the preset to-be-trained traveling salesman problem solving model are trained to obtain the traveling salesman problem solving model that meets the accuracy conditions.

3. The method for analyzing the traveling salesman problem according to claim 2, wherein: The step of training the undetermined parameters in the preset traveling salesman problem solving model to be trained based on the preset training samples with the traveling salesman solution label to obtain the traveling salesman problem solving model that meets the accuracy condition includes: Preprocessing the preset training samples to obtain the traveling salesman problem data; Inputting the traveling salesman problem data into the preset traveling salesman problem-solving model to be trained, converting the traveling salesman problem data into target traveling salesman problem data approximately obeying a Gaussian distribution based on multiple neural network layers of the preset traveling salesman problem-solving model to be trained, and performing calculations on the target traveling salesman problem data to obtain analysis results of the target traveling salesman problem data; Calculating the error between the analysis result and the traveling salesman solution label based on a gradient descent method to obtain an error calculation result; Based on the error calculation result, the undetermined parameters in the linear model to be trained are updated, and the process returns to the step of preprocessing the preset training samples to obtain the traveling salesman problem data, until a traveling salesman problem solving model that meets the accuracy conditions is obtained.

4. The method for analyzing the traveling salesman problem according to claim 3, wherein: The step of converting the traveling salesman problem data into target traveling salesman problem data approximately obeying a Gaussian distribution based on the multiple neural network layers of the preset traveling salesman problem solving model to be trained comprises: Based on the undetermined parameters, first-order moments and second-order moments of the target model parameters are calculated; The calculation formulas for the first-order moment and the second-order moment are respectively: Assuming that the target traveling salesman problem data approximately obeys a Gaussian distribution, and calculating the mean and variance of the Gaussian distribution based on the first-order moment and second-order moment of the target model parameters; The calculation formulas for the mean and variance of the Gaussian distribution are: in, is the preset training sample after vectorization processing, the For the -1 layer neural network the number of elements in the vector; Calculating the target traveling salesman problem data that approximately obeys the Gaussian distribution based on the preset training samples after the vectorization processing and the mean and variance of the Gaussian distribution; The target traveling salesman problem data is expressed as follows: Among them, the is a random variable that follows a standard normal distribution.

5. The method for analyzing the traveling salesman problem according to claim 4, wherein: The step of inputting the traveling salesman problem data, performing prediction processing on the traveling salesman problem data based on the traveling salesman problem solving model, and obtaining an analysis result of the traveling salesman problem data includes: Randomly sampling the random variables that obey the standard normal distribution, inputting the target traveling salesman problem data obtained by the random sampling into the preset traveling salesman problem-solving model to be trained, and performing calculations on the target traveling salesman problem data based on the preset traveling salesman problem-solving model to be trained to obtain analysis results of the target traveling salesman problem data; The step of calculating the error between the analysis result and the traveling salesman solution label based on the gradient descent method to obtain the error calculation result includes: Calculating the error between the analysis result and the traveling salesman solution label based on a preset gradient descent calculation formula to obtain an error calculation result; Among them, the preset gradient descent calculation formula is: in, The undetermined parameters 、 、 and A collection of is the learning rate of the preset traveling salesman problem solving model to be trained, The original loss function of the preset traveling salesman problem solving model to be trained.

6. The method for analyzing the traveling salesman problem according to claim 3, wherein: After the step of updating the undetermined parameters in the linear model to be trained based on the error calculation result and returning to the step of preprocessing the preset training samples to obtain the traveling salesman problem data until a traveling salesman problem solving model that meets the accuracy condition is obtained, the method further includes: Based on the spike and slab distribution, randomly sampling target model parameters in the traveling salesman problem solving model that meets the accuracy condition to obtain multiple target traveling salesman problem solving models; Testing the target traveling salesman problem solving model based on a test sample pre-divided from the preset training sample to obtain a target traveling salesman solution for the test sample; The mean of the target traveling salesman solution is used as the traveling salesman solution of the test sample, and the standard deviation of the target traveling salesman solution is used as the uncertainty estimate of the traveling salesman problem solving model that meets the accuracy condition.

7. The method for analyzing the traveling salesman problem according to claim 6, wherein: Before the step of randomly sampling target model parameters in the traveling salesman problem solving model that meets the accuracy condition based on the spike and slab distribution to obtain multiple target traveling salesman problem solving models, the method further includes: If the weight of the spike distribution of the target model parameter in the traveling salesman problem solving model that meets the accuracy condition is close to 1, and the spike centroid is close to 0, the traveling salesman problem solving model that meets the accuracy condition is not tested.

8. An analysis device for the traveling salesman problem, characterized in that: The device comprises: An uncertainty assessment module is configured to input traveling salesman problem data, perform predictive processing on the traveling salesman problem data based on a traveling salesman problem-solving model, and obtain analysis results of the traveling salesman problem data, wherein the analysis results include uncertainty estimates of the traveling salesman solution and the traveling salesman problem-solving model. The traveling salesman problem data includes a list of n cities, and the traveling salesman solution includes a specific arrangement of n cities that minimizes the total itinerary. The traveling salesman problem-solving model is obtained by training pending parameters of target model parameters in a preset traveling salesman problem-solving model to be trained based on preset training samples labeled with traveling salesman solutions. The target model parameters are obtained by replacing original model parameters in the preset traveling salesman problem-solving model to be trained from point values ​​with a spike and slab distribution, where the spike and slab distribution is defined by multiple pending parameters. The analysis results are obtained by randomly sampling the target model parameters in the trained traveling salesman problem-solving model and predicting the traveling salesman problem data based on the target traveling salesman problem-solving model obtained by random sampling.

9. An analytical device for the traveling salesman problem, characterized in that The device includes: a memory, a processor, and a traveling salesman problem analysis program stored in the memory and executable on the processor, wherein the traveling salesman problem analysis program is configured to implement the steps of the traveling salesman problem analysis method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores an analysis program for the traveling salesman problem, which, when executed by a processor, implements the steps of the analysis method for the traveling salesman problem according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Model migration method and device and electronic equipment

    CN115131633A

  • Information Robust Dirichlet Networks for Predictive Uncertainty Estimation

    US20210103814A1