Training method and device of manifold geodesic calculation model, equipment and medium

Through the multi-stage training method based on the variance function and the mean function in the VAE model, the problem that the variance function cannot accurately reflect the spatial relationship of the input data when the VAE model generates data is solved, and the potential variability of the data is effectively generated.

CN118607606AActive Publication Date: 2024-09-06SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410545105.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2024-09-06
Estimated Expiration
2044-04-30

AI Technical Summary

Technical Problem

When the existing VAE model generates data, the variance function cannot accurately reflect the spatial relationship of the original input data samples, resulting in the inability to effectively generate new data.

Method used

By constructing a variational autoencoder based on the variance function and the mean function, the mean function is first trained in the first stage, and then the variance function is trained while keeping the mean function unchanged, and the parameter values ​​of the randomized manifold space are learned to Generate new data.

Benefits of technology

The variance function can accurately reflect the spatial relationship of the original data samples and effectively generate new data based on the potential variability of the original data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607606A
    Figure CN118607606A
Patent Text Reader

Abstract

The invention provides a manifold geodesic calculation model training method and device, equipment and a medium, and relates to the technical field of model training, and the method comprises the steps: obtaining each weight of a to-be-trained variational auto-encoder mean value function through first-stage training, and obtaining each weight of a to-be-trained variational auto-encoder mean value function through second-stage training; and obtaining each weight of a difference function of the variational auto-encoder subjected to first-stage training, learning parameter values of a randomized manifold space after determining each weight containing a mean value function and each weight containing a variance function, and generating data through the parameter values of the randomized manifold space. The trained variance function can accurately reflect the original data sample space relation, and new data can be effectively generated based on the potential variability of the original data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of model training technology, and in particular to a training method, device, equipment and medium for a manifold geodesic calculation model. Background Art

[0002] The VAE (Variational Auto-Encoder) model generates a network that constructs random variables and randomized space. If the reconstructed original data sample contains a manifold structure, the generated sample is a special manifold with random information in the space, which is called a randomized manifold.

[0003] The randomized manifold will have different randomized components, i.e., uncertainty, at different locations in its space. If the known sample size in a certain area of ​​the original data space is large, the random component in the corresponding generated space area will be weak. Conversely, if the known sample size in a certain area of ​​the original data space is small, the corresponding generated data will be highly random, i.e., have high noise. From the VAE encoder network output formula f(z) = μ(z) + σ(z) · ε, it can be seen that the VAE encoder network outputs a mean function μ(z) and a variance function σ(z), which define the probability distribution of each sample in the latent space. Among them, the amount of ε noise term introduced depends on the result of the variance function.

[0004] The current variance function cannot accurately reflect the spatial relationship of the original input data samples, and therefore cannot effectively generate new data based on the potential variability of the original input data. Summary of the invention

[0005] In view of this, embodiments of the present application provide a training method, apparatus, device and medium for a manifold geodesic calculation model to overcome the above problems or at least partially solve the above problems.

[0006] A first aspect of the embodiments of the present application provides a training method, apparatus, device and medium for a manifold geodesic calculation model, the method comprising:

[0007] Based on the variance function and the mean function, construct the variational autoencoder to be trained;

[0008] Under the condition that the output value of the variance function is set to a constant, the first stage training is performed on the variational autoencoder to be trained, and at the end of the first stage training, each weight of the mean function is obtained;

[0009] Under the condition that each weight of the mean function remains unchanged, the variational autoencoder trained in the first stage is trained in the second stage, and at the end of the second stage training, each weight of the variance function is obtained;

[0010] While keeping the obtained weights of the mean function and the variance function unchanged, the parameter values ​​of the randomized manifold space are learned, and the parameter values ​​of the randomized manifold space are used for data generation.

[0011] Optionally, the learning of parameter values ​​of the randomized manifold space while keeping the obtained weights of the mean function and the obtained weights of the variance function unchanged includes:

[0012] Under the condition that each weight of the mean function and each weight of the variance function remain unchanged, the parameter set of the cubic spline curve is updated by using the parameter set optimization formula;

[0013] In the process of updating the parameter set of the cubic spline curve, a target parameter set is determined, where the target parameter set is a parameter set that enables the cubic spline curve to reach an optimal state in a latent variable space;

[0014] Based on the target parameter set, obtaining a parameter set expression of the target cubic spline curve;

[0015] The method further comprises:

[0016] After the training of the second stage is completed, a reconstructed network is obtained based on each weight of the mean function and each weight of the variance function;

[0017] Based on the reconstruction network, the target cubic spline curve is mapped to the generation space, so that the distance between two given points is connected with the shortest distance in the generation space through the target cubic spline curve, and the relationship between the two given points is represented to complete the reconstruction and generation of the data.

[0018] Optionally, the parameter set optimization formula is:

[0019]

[0020] The method further comprises: * The update amount of the parameter set is calculated by taking derivatives and adopting the stochastic gradient descent method to obtain the target parameter set.

[0021] Optionally, while keeping the weights of the mean function unchanged, performing the second stage training on the variational autoencoder trained in the first stage, and obtaining the weights of the variance function at the end of the second stage training, including:

[0022] Establish a weighted Gaussian mixture model;

[0023] characterizing the variance function based on the weighted Gaussian mixture model;

[0024] Wherein, the weighted Gaussian mixture model is: K represents the number of Gaussian components in the weighted Gaussian mixture model, c i represents the mean and ∑ of the i-th component i represents the covariance of the i-th component, ω i represents the mixing coefficient, W g ∈R D represents the weight vector, and z represents the latent variable.

[0025] Optionally, the method further comprises:

[0026] The weight vector W of the weighted Gaussian mixture model is trained g ;

[0027] In the weight vector W g After the training is completed, based on the weight vector W after the training is completed g , update the weights of the variance function.

[0028] Optionally, the method further comprises:

[0029] Setting the covariance in the weighted Gaussian mixture model to a diagonal matrix;

[0030] By log(σ 2 (z)) to obtain the output value of the variance function.

[0031] Optionally, the first stage training is performed on the variational autoencoder to be trained when the output value of the variance function is set to a constant, and at the end of the first stage training, each weight of the mean function is obtained, including:

[0032] Setting the output value of the variance function to a constant;

[0033] An output value of the mean function is obtained, and based on the output value of the mean function, it is determined whether each weight of the mean function has been updated.

[0034] A second aspect of an embodiment of the present application provides a training device for a manifold geodesic calculation model, the device comprising:

[0035] A construction module is used to construct a variational autoencoder to be trained based on the variance function and the mean function;

[0036] A first-stage training module is used to perform first-stage training on the variational autoencoder to be trained while setting the output value of the variance function to a constant, and obtain each weight of the mean function at the end of the first-stage training;

[0037] A second-stage training module is used to perform second-stage training on the variational autoencoder trained in the first stage while keeping the weights of the mean function unchanged, and obtain the weights of the variance function at the end of the second-stage training;

[0038] The learning module is used to learn the parameter values ​​of the randomized manifold space while keeping the obtained weights of the mean function and the variance function unchanged, and the parameter values ​​of the randomized manifold space are used for data generation.

[0039] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the training method of the manifold geodesic calculation model as described in the first aspect.

[0040] A fourth aspect of the embodiments of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the training method of the manifold geodesic calculation model as described in the first aspect is implemented.

[0041] Beneficial effects of this application:

[0042] An embodiment of the present application provides a training method for a manifold geodesic calculation model, the method comprising: constructing a variational autoencoder to be trained based on a variance function and a mean function; performing a first-stage training on the variational autoencoder to be trained while setting the output value of the variance function to a constant, and obtaining each weight of the mean function at the end of the first-stage training; performing a second-stage training on the variational autoencoder trained in the first stage while keeping each weight of the mean function unchanged, and obtaining each weight of the variance function at the end of the second-stage training; while keeping each weight of the obtained mean function and each weight of the variance function unchanged, learning parameter values ​​of a randomized manifold space, and the parameter values ​​of the randomized manifold space are used for data generation. Through the first stage of training, the weights of the mean function of the variational autoencoder to be trained are obtained, and through the second stage of training, the weights of the difference function of the variational autoencoder trained in the first stage are obtained. After determining the weights of the mean function and the weights of the variance function, the parameter values ​​of the randomized manifold space are learned, and data is generated by the parameter values ​​of the randomized manifold space. The variance function after training can accurately reflect the spatial relationship of the original data samples, and effectively generate new data based on the potential variability of the original data. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.

[0044] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 A training method for a manifold geodesic calculation model provided in an embodiment of the present application;

[0046] Figure 2 It is a schematic diagram of the training at each stage and its structure in a training method of a manifold geodesic calculation model provided in an embodiment of the present application;

[0047] Figure 3 It is a schematic diagram of a random optimization algorithm for a parameter set S for training and learning a cubic spline curve C in a training method for a manifold geodesic calculation model provided in an embodiment of the present application;

[0048] Figure 4 A training device for a manifold geodesic calculation model is provided in one embodiment of the present application. DETAILED DESCRIPTION

[0049] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] Instead of compressing each sample to a single point, the encoder network of a variational autoencoder (VAE) maps each sample to a standard normal distribution. This means that the encoder network outputs a mean vector and a covariance matrix that defines the probability distribution of each sample in the latent space. By mapping samples to a probability distribution, VAE is able to capture the underlying variability of the data. This means that VAE can generate more diverse and realistic data than traditional autoencoders. The latent space of a VAE is designed to be a continuous distribution. This means that we can sample and interpolate the latent representation to generate new, realistic data points. This makes VAE an effective generative model because it can generate new data points that are similar to the training data.

[0052] Suppose there is a vector of latent variables z in a high-dimensional space, which can be easily sampled according to some probability density function P(z) defined on the high-dimensional space. Given a function f(z;θ), parameterized by a vector θ in some space Θ, where f:Z×Θ→X. f is deterministic, so if the latent variable z is random and θ is fixed, then f(z;θ) is a random variable in space χ. Maximizing the probability of each X in the training set during the entire generation process is: P(X) = ∫P(X|z;θ)P(z)dz

[0053] In VAE, the choice of output distribution is usually Gaussian distribution, that is, P(X|z;θ)=N(X|f(z;θ),σ 2 *I), that is, its mean is f(z;θ) and its covariance is equal to the identity matrix I multiplied by some scalar σ.

[0054] Therefore, a new function is needed that takes the value of X as input and provides a distribution of z values ​​that may produce X. The purpose of this is to hope that the space of latent variable z values ​​generated by Q will be smaller than all the spaces generated under the prior P(z).

[0055] First, we define the Kullback-Leibler divergence (KL divergence) between P(z|X) and Q(z). For any Q: KL(Q(z)|P(z|X))=E z~Q [logQ(z)-logP(z|X)].

[0056] Further, applying Bayes’ theorem to P(z|X), we can obtain: KL(Q(z)|P(z|X))=E z~Q [logQ(z)-logP(X|z)-logP(z)]+logP(X).

[0057] Among them, logP(X) does not depend on the hidden variable z and is outside the expectation. Negate both sides and rearrange them to get:

[0058] logP(X)-KL(Q(z)|P(z|X))=E z~Q [logP(X|z)]-D[Q(z)||P(z)]

[0059] In this case X is fixed and Q can be of any distribution. Since we are interested in inferring P(X), it does make sense to construct Q that depends on X in order to make KL(Q(z)|P(z|X)) small.

[0060] logP(X)-KL(Q(z|X)|P(z|X))=E z~Q [logP(X|z)]-KL(Q(z|X)|P(z))

[0061] This equation is the core of the variational autoencoder. On the left side we have the quantity we want to maximize: logP(X), and on the right side we can optimize the right choice of Q via stochastic gradient descent.

[0062] Usually choose The KL divergence between two multivariate Gaussian distributions can be calculated in closed form:

[0063]

[0064] In our case this simplifies to

[0065]

[0066] The first term on the right side of the formula is E z~Q [logP(X|z)], as the standard for stochastic gradient descent, takes a sample of z and treats that z as E z~Q Approximate value of [logP(X|z)].

[0067] The complete equation to be optimized is: E X~D [logP(X)-KL(Q(z|X)|P(z|X))]= E X~D [E z~Q [logP(X|z)]-KL(Q(z|X)|P(z))]

[0068] We can sample a single X value and a single z value from the distribution Q(z|X) and compute the gradient:

[0069] logP(X|z)-KL(Q(z|X)|P(z))

[0070] Since the latent variables need to obey a certain distribution, if this distribution is generated directly, the computational graphs of the encoder and decoder will be disconnected, and the back-propagation method will not be able to optimize the encoder and decoder.

[0071] In order to solve this problem, the reparameterization technique is used. That is, in the actual model, the encoder does not directly generate latent variables, but outputs the parameters that the latent variables obey, and then uses these parameters to generate latent variables that obey a certain distribution.

[0072] Given the mean μ(X) and covariance Σ(X) of Q(z|X), a linear transformation z=μ(X)+Σ is performed by sampling ε~N(0,I) 1 / 2 (X)*ε, to achieve sampling from N(μ(X),Σ(X)). Then the actual gradient equation is:

[0073] E X~D [E ε~N(0,I) [logP(X|z=μ(X)+Σ 1 / 2 (X)*ε)]-KL(Q(z|X)|P(z))]

[0074] The feed-forward behavior of both networks is the same, but back-propagation can only be applied to Figure 2 network.

[0075] During testing, when a new sample needs to be generated, only the value of z~N(0,I) is input into the decoder. In other words, the "encoder" is removed, including the multiplication and addition operations that will change the distribution of z.

[0076] The randomized manifold has different randomization components, or uncertainties, at different locations in its space. Intuitively speaking, if the known sample size in a certain area of ​​the original data space is large, the random component in the corresponding generated space area is weak. Conversely, if the known sample size in a certain area of ​​the original data space is small, the corresponding generated data is highly random, that is, the noise is large. From f(z) = μ(z) + σ(z) · ε, we can see that the amount of noise term ε introduced depends on the variance function σ 2 (·) result; therefore, how to establish a network structure that can accurately reflect the spatial relationship of the original data samples to characterize the variance function σ 2 (·) is of vital importance.

[0077] Therefore, we hope to achieve the following goals: the variance function σ 2 (·) In the area with high data density in the latent variable space, its value is small, and vice versa. In the related art, there is a method using RBF network to calculate the inverse of the variance function to meet the desired effect. After our simulation test and analysis of the data, we found that RBF network has certain limitations and the initial center point has a greater impact.

[0078] Based on the above technical problems, this application proposes a training method, device, equipment and medium for a manifold geodesic calculation model. Figure 1A training method for a manifold geodesic calculation model provided in an embodiment of the present application is provided. Figure 2 FIG. 1 is a schematic diagram of the training of each stage and its structure in a training method of a manifold geodesic calculation model provided in an embodiment of the present application, such as Figure 1 and Figure 2 As shown, an embodiment of the present application provides a training method for a manifold geodesic calculation model, the method comprising:

[0079] In step S101, a variational autoencoder to be trained is constructed based on the variance function and the mean function;

[0080] In step S102, the variational autoencoder to be trained is trained in the first stage while setting the output value of the variance function to a constant. At the end of the first stage of training, each weight of the mean function is obtained;

[0081] In step S103, while keeping the weights of the mean function unchanged, the variational autoencoder trained in the first stage is trained in the second stage, and at the end of the second stage training, the weights of the variance function are obtained;

[0082] In step S104, while keeping the obtained weights of the mean function and the variance function unchanged, the parameter values ​​of the randomized manifold space are learned, and the parameter values ​​of the randomized manifold space are used for data generation.

[0083] First, in step S101, a variational autoencoder to be trained is constructed based on the variance function and the mean function.

[0084] In an embodiment of the present application, in order to enable the data generation model to learn the potential representation of the data and generate new samples with similar distribution, the variational autoencoder utilizes the ideas of encoding and decoding, which are used to map the input data to the latent space and to map the latent variables to the visible space, respectively. The model is trained by maximizing the marginal probability of the observed data. The variance function and the mean function are used to define the loss function of the variational autoencoder. In the definition of the loss function, the variance function and the mean function play an important role. The variance function is responsible for measuring the dispersion of the latent variables, while the mean function is responsible for measuring the mean of the latent variables. By optimizing the variance function and the mean function, the variational autoencoder can learn a representation with a suitable distribution in the latent space. Therefore, before training the variational autoencoder, it is necessary to first construct the variance function and the mean function, that is, to initialize the variance function and the mean function. The variational autoencoder to be trained is constructed by the variance function and the mean function to enable the model to learn the potential representation of the input data from the input data, so as to facilitate the subsequent optimization of the variance function and the mean function to achieve reasonable modeling of the latent space.

[0085] Further, in step S102, the variational autoencoder to be trained is subjected to first-stage training with the output value of the variance function set as a constant, and at the end of the first-stage training, each weight of the mean function is obtained.

[0086] In the embodiment of the present application, the variational autoencoder to be trained is trained in a manner of being divided into multiple stages of training, such as Figure 2 As shown in the figure, the encoding network consists of three parts. H-enc represents the number of hidden layers of neural network structure that the input data needs to pass through. M-enc and S-enc represent the mean function network and variance function network that constitute the hidden variable space in the VAE model encoding process. The generation network also consists of three parts. H-dec represents the number of hidden layers of neural network structure that the hidden variable data needs to pass through as input. M-dec and S-dec represent the mean function network and variance function network when generating the randomized space.

[0087] The output value of the variance function is calculated based on the actual distribution of the input data and is used to measure the degree of discreteness or change of the data. In the first stage of training, in order to ignore the change of the input data, the output value of the variance function is set to a constant less than the preset threshold, so that the variance function is insensitive to the change of the input data, that is, regardless of the actual distribution of the input data, the output value of the variance function remains constant. When the output value of the variance function remains a constant, the mean function of the variational autoencoder to be trained is trained in the first stage, so that at the end of the first stage of training, the weights of the mean function of the variational autoencoder to be trained are obtained. The mean function is a part of the encoder network of the variational autoencoder. The mean function can map the input data to the mean vector in the latent space. By training the weights of the mean function, the generated data can be better approximated to the distribution of the input data.

[0088] Further, in step S103, while keeping the weights of the mean function unchanged, the variational autoencoder trained in the first stage is trained in the second stage, and at the end of the second stage training, the weights of the variance function are obtained.

[0089] In an embodiment of the present application, after the training of the various weights of the mean function of the first stage training is completed, it is necessary to further perform second-stage training on the variational autoencoder that has undergone the first stage training. Before the second stage training, it is necessary to keep the various weights of the mean function that have been trained in the first stage training unchanged, and perform second-stage training on the variance function of the variational autoencoder that has undergone the first stage training, wherein training the variance function means optimizing the variance function to minimize the difference between the generated data and the original input data, and at the end of the second stage training, obtaining the various weights of the variance function.

[0090] Finally, in step S104, while keeping the obtained weights of the mean function and the variance function unchanged, the parameter values ​​of the randomized manifold space are learned, and the parameter values ​​of the randomized manifold space are used for data generation.

[0091] In an embodiment of the present application, after the weights of the mean function of the variational autoencoder to be trained are trained by the first stage training and the weights of the variance function of the variational autoencoder to be trained are trained by the second stage training, the parameter values ​​of the randomized manifold space are learned while keeping the weights of the mean function and the weights of the variance function unchanged, wherein the parameter values ​​of the randomized popular space are learned by training the model to determine the parameter values ​​in the manifold space. In machine learning, the manifold space refers to the nonlinear structure of the data, in which there are complex relationships and patterns. Learning the parameter values ​​of the manifold space means adjusting the parameters of the model so that it can better fit, describe or capture this nonlinear structure in the data. By learning the parameter values ​​of the manifold space, the model can better model and predict the data, thereby improving its performance and generalization ability. This process usually involves using an optimization algorithm, such as gradient descent, to minimize the loss function of the model and update the parameter values ​​so that it can better adapt to the manifold structure of the data, and the parameter values ​​of the randomized manifold space obtained by learning are used for data generation, and the variational autoencoder finally completed by training can be used to complete a variety of downstream tasks such as data generation, including:

[0092] Generate new samples: By learning the latent representation of the data, and generating new samples that are similar but not identical to the training data. This has great application potential for generating realistic images, text, music, etc.

[0093] Data reconstruction and denoising: It is used to reconstruct the original input data, including images, text, etc. It can recover the original data from damaged or noise-contaminated samples, which is helpful for data recovery and denoising tasks.

[0094] Feature learning and data dimensionality reduction: Learn meaningful low-dimensional representations of data to achieve data dimensionality reduction and feature learning. This representation can be used for subsequent classification, clustering and other tasks.

[0095] Anomaly detection: Learn the distribution of normal data to detect abnormal data. By comparing the reconstruction error or the distance in the latent space, anomaly samples that are different from the training data can be identified.

[0096] Semi-supervised learning and transfer learning: Semi-supervised learning is achieved by introducing label information in the encoder. It can also perform transfer learning between data in different fields and apply the learned latent representation to new tasks.

[0097] Through the above embodiment, it is possible to obtain the weights of the mean function of the variational autoencoder to be trained through the first stage training, and obtain the weights of the difference function of the variational autoencoder trained in the first stage through the second stage training, and after determining the weights including the mean function and the variance function, learn the parameter values ​​of the randomized popular space, and generate data through the parameter values ​​of the randomized manifold space. The trained variance function can accurately reflect the sample space relationship of the original input data, and effectively generate new data based on the potential variability of the original input data.

[0098] Figure 3 is a schematic diagram of a random optimization algorithm for training a parameter set S of a cubic spline curve C in a training method of a manifold geodesic calculation model provided in an embodiment of the present application, such as Figure 3 shown.

[0099] Optionally, the step S104 includes:

[0100] Under the condition that each weight of the mean function and each weight of the variance function remain unchanged, the parameter set of the cubic spline curve is updated by using the parameter set optimization formula;

[0101] In the process of updating the parameter set of the cubic spline curve, a target parameter set is determined, where the target parameter set is a parameter set that enables the cubic spline curve to reach an optimal state in a latent variable space;

[0102] Based on the target parameter set, obtaining a parameter set expression of the target cubic spline curve;

[0103] The method further comprises:

[0104] After the training of the second stage is completed, a reconstructed network is obtained based on each weight of the mean function and each weight of the variance function;

[0105] Based on the reconstruction network, the target cubic spline curve is mapped to the generation space, so that the distance between two given points is connected with the shortest distance in the generation space through the target cubic spline curve, and the relationship between the two given points is represented to complete the reconstruction and generation of the data.

[0106] Specifically, in the embodiment of the present application, while keeping the obtained weights of the mean function and the obtained weights of the variance function unchanged, learning the parameter values ​​of the randomized manifold space includes the following steps:

[0107] Step 1: Keep the weights of the neural network representing the mean function and variance function unchanged.

[0108] Step 2: Train and update the parameter set of the cubic spline curve, and obtain the optimal parameter value through the optimization algorithm.

[0109] Step 3: In the latent variable space, the learned curve is represented by the optimal curve parameter expression.

[0110] Step 4: Map the learned curve into the generated space through the reconstruction network.

[0111] Step 5: In the generated space, use the maximum likelihood method to connect the distance between two points so that the generated curve fits the original data as closely as possible.

[0112] The following is a detailed description of steps 1 to 5:

[0113] First, according to step 1, keep the weights of the mean function μ and the variance function σ 2 The weights of the cubic spline curve C remain unchanged, and the parameter set optimization formula is used to update the parameter set S of the cubic spline curve C to obtain the optimal result of its learning. According to step 2, in this training and updating process, the training data is used to update the parameter set S of the cubic spline curve C so that it can better fit the training data and obtain a more accurate curve representation. Further, according to step 3, in the process of updating the parameter set of the cubic spline curve, the target parameter set is determined. The target parameter set is a parameter set that can make the cubic spline curve reach the optimal state in the latent variable space. The parameter set of the spline curve is updated through multiple iterations. The goal is to find the parameter set that can best fit the training data as the target parameter set. The target parameter set enables the cubic spline curve to accurately represent the characteristics and patterns of the training data; further, the parameter set expression of the target cubic spline curve is determined through the obtained target parameter set.

[0114] Further, according to step 4, after the second stage of training is completed, the reconstruction network f is obtained through the weights of the mean function and the weights of the variance function, and the target cubic spline curve is mapped to the generation space through the reconstruction network f; according to step 5, the distance between two given points is connected with the shortest distance in the generation space through the target cubic spline curve, and the relationship between the two given points is represented to complete the reconstruction and generation of the data.

[0115] Through the above embodiments, it is possible to learn the optimal cubic spline curve parameter expression through training and optimization, and use the generative model to map the learned curve into the generative space to obtain the curve that is most similar to the original data.

[0116] Optionally, the parameter set is derived, and a stochastic gradient descent method is used to calculate an update amount of the parameter set to obtain the target parameter set.

[0117] Specifically, in the embodiment of the present application, the parameter values ​​in the cubic spline curve under the condition of minimizing the distance are realized by weight learning and updating of the neural network. From the distance of the randomized popularization, it can be known that the parameter set optimization formula can be expressed as:

[0118]

[0119] Among them, S * Represents a parameter set, which contains parameter a * ,b * ,c * , σ 2 represents the variance function, and μ represents the mean function.

[0120] Through the above embodiments, the generated cubic spline curve can be better adapted to the required distance conditions through neural network training and weight updating, and can be easily applied to various application fields, such as image processing, robot path planning, etc., to achieve precise control and optimization of the curve shape.

[0121] Optionally, the step S103 includes:

[0122] Establish a weighted Gaussian mixture model;

[0123] characterizing the variance function based on the weighted Gaussian mixture model;

[0124] Wherein, the weighted Gaussian mixture model is: K represents the number of Gaussian components in the weighted Gaussian mixture model, c i represents the mean and ∑ of the i-th component i represents the covariance of the i-th component, ω i represents the mixing coefficient, W g∈R D represents the weight vector, and z represents the latent variable.

[0125] Specifically, in the embodiment of the present application, the second stage training is actually to train the parameters of the established weighted Gaussian mixture model. Therefore, in the embodiment of the present application, it is necessary to first establish a weighted Gaussian mixture model, and the variance function is characterized by the established weighted Gaussian mixture model. The weighted Gaussian mixture model is: K represents the number of Gaussian components in the weighted Gaussian mixture model, c i represents the mean and ∑ of the i-th component i represents the covariance of the i-th component, ω i represents the mixing coefficient, W g ∈R D represents the weight vector, and z represents the latent variable.

[0126] Through the above embodiment, the variance function can be characterized by a weighted Gaussian mixture model (rescaled GMM), so that a larger inverse of the variance function will make the corresponding Gaussian component weight smaller, thereby reducing its influence on the entire model, while a smaller inverse of the variance function will make the corresponding Gaussian component weight larger, increasing its influence on the entire model, based on adjusting the contribution of each Gaussian component to the entire model, to achieve flexible modeling of data distribution.

[0127] Optionally, the method further comprises:

[0128] The weight vector W of the weighted Gaussian mixture model is trained g ;

[0129] In the weight vector W g After the training is completed, based on the weight vector W after the training is completed g , update the weights of the variance function.

[0130] Specifically, in the embodiment of the present application, the weight vector determines the proportion of each Gaussian distribution in the weighted Gaussian mixture model. A larger weight means that the corresponding Gaussian distribution has a higher probability when generating data, indicating that the sample generated by it is more important. A smaller weight means that the corresponding Gaussian distribution contributes less to the generated data.

[0131] The weight vector W of the established weighted Gaussian mixture model g Training can control the relative importance of each Gaussian distribution in the weighted Gaussian mixture model. The weight vector defines the weight of each Gaussian distribution, indicating the contribution of each data distribution to the final result when generating data. Larger weights can be used to capture the main patterns and structures in the data, while smaller weights can be used to deal with noise or minor components in the data.

[0132] And in the weight vector W g After the training is completed, the weight vector W after the training is completed g , update the weights of the variance function and complete the second stage of training.

[0133] Through the above embodiment, the weight vector W can be adjusted g , the complexity and flexibility of the weighted Gaussian mixture model can be adjusted to adapt to the modeling needs of different data distributions.

[0134] Optionally, the method further comprises:

[0135] Setting the covariance in the weighted Gaussian mixture model to a diagonal matrix;

[0136] By log(σ 2 (z)) to obtain the output value of the variance function.

[0137] Specifically, in the embodiment of the present application, considering the computational efficiency, the covariance of each Gaussian component of the weighted Gaussian mixture model can be set to a diagonal matrix. Taking the latent variable as the object, the weighted Gaussian mixture model and the corresponding weights are established and calculated. In order to avoid the inconvenience in numerical expression caused by too small, logarithmization is often used in practice, that is, log(σ 2 (z)) to observe the output value of the variance function.

[0138] Through the above-mentioned embodiment, it is possible to set the covariance in the weighted Gaussian mixture model to a diagonal matrix. Since the calculation of the diagonal covariance matrix is ​​relatively simple, the complexity of the calculation is reduced and the calculation efficiency is improved. The diagonal covariance matrix only needs to store the variance of each feature, and does not need to store the covariance between features. The number of model parameters that need to be estimated is reduced, especially in the case of high-dimensional data, the complexity and storage requirements of the model can be reduced, and the diagonal covariance matrix makes the variance and importance of each feature clearer. By observing the variance of each feature, it is possible to understand the range of variation of the feature in the data and the degree of contribution to the model.

[0139] Optionally, the step S102 includes:

[0140] Setting the output value of the variance function to a constant;

[0141] An output value of the mean function is obtained, and based on the output value of the mean function, it is determined whether each weight of the mean function has been updated.

[0142] Specifically, in an embodiment of the present application, the output value of the variance function is set to a constant to prevent the input value of the variance function from changing with the training of the mean function, and the mean function is trained when the variance function is set to a constant. Through the output value of the mean function, it can be determined that the update of each weight of the mean function has been completed.

[0143] Through the above embodiments, a stable generation space can be obtained under the premise of small constraint noise.

[0144] Figure 4 is a training device for a manifold geodesic calculation model provided by an embodiment of the present application, such as Figure 4 As shown, an embodiment of the present application provides a training device for a manifold geodesic calculation model, the device comprising:

[0145] A construction module 11 is used to construct a variational autoencoder to be trained based on a variance function and a mean function;

[0146] The first stage training module 12 is used to perform the first stage training on the variational autoencoder to be trained under the condition that the output value of the variance function is set to a constant, and obtain the weights of the mean function at the end of the first stage training;

[0147] The second stage training module 13 is used to perform second stage training on the variational autoencoder trained in the first stage while keeping the weights of the mean function unchanged, and obtain the weights of the variance function at the end of the second stage training;

[0148] The learning module 14 is used to learn the parameter values ​​of the randomized manifold space while keeping the obtained weights of the mean function and the variance function unchanged, and the parameter values ​​of the randomized manifold space are used for data generation.

[0149] Optionally, the learning module 14 includes:

[0150] An updating module, used to update the parameter set of the cubic spline curve by using a parameter set optimization formula while keeping the weights of the mean function and the weights of the variance function unchanged;

[0151] A determination module, used to determine a target parameter set in the process of updating the parameter set of the cubic spline curve, wherein the target parameter set is a parameter set that enables the cubic spline curve to reach an optimal state in a latent variable space;

[0152] A parameter set expression acquisition module, used for acquiring a parameter set expression of the target cubic spline curve based on the target parameter set;

[0153] The device also includes:

[0154] A reconstructed network acquisition module, used for acquiring a reconstructed network based on each weight of the mean function and each weight of the variance function after the training of the second stage is completed;

[0155] A mapping module is used to map the target cubic spline curve to a generation space based on the reconstruction network, so as to connect the distance between two given points in the generation space with the shortest distance through the target cubic spline curve, and to represent the relationship between the two given points, so as to complete the reconstruction and generation of data.

[0156] Optionally, the parameter set optimization formula is:

[0157]

[0158] The device also includes: a calculation module for calculating S * The update amount of the parameter set is calculated by taking derivatives and adopting the stochastic gradient descent method to obtain the target parameter set.

[0159] Optionally, the second stage training module 13 includes:

[0160] Establish a module for establishing a weighted Gaussian mixture model;

[0161] A characterization module, configured to characterize the variance function based on the weighted Gaussian mixture model;

[0162] Wherein, the weighted Gaussian mixture model is: K represents the number of Gaussian components in the weighted Gaussian mixture model, c i represents the mean and ∑ of the i-th component i represents the covariance of the i-th component, ω i represents the mixing coefficient, W g ∈R D represents the weight vector, and z represents the latent variable.

[0163] Optionally, the device further comprises:

[0164] A training unit, used to train the weight vector W of the weighted Gaussian mixture model g ;

[0165] An updating unit is used to update the weight vector W g After the training is completed, based on the weight vector W after the training is completed g , update the weights of the variance function.

[0166] Optionally, the device further comprises:

[0167] A covariance setting module, used to set the covariance in the weighted Gaussian mixture model to a diagonal matrix;

[0168] Output module, used to pass log(σ 2 (z)) to obtain the output value of the variance function.

[0169] Optionally, the first-stage training module 12 includes:

[0170] A variance function setting module, used to set the output value of the variance function to a constant;

[0171] The mean function weight determination module is used to obtain the output value of the mean function and determine whether the weights of the mean function have been updated based on the output value of the mean function.

[0172] Based on the same inventive concept, another embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the training method of the manifold geodesic calculation model as described in any of the above embodiments.

[0173] Based on the same inventive concept, another embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to perform the training method of the manifold geodesic calculation model as described in any of the above embodiments.

[0174] Based on the same inventive concept, another embodiment of the present application further provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the training method of the manifold geodesic calculation model as described in any of the above embodiments is implemented.

[0175] As for the device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0176] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0177] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0178] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0179] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0181] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0182] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0183] The above is a detailed introduction to the training method, device, equipment and medium of a manifold geodesic calculation model provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A training method for a manifold geodesic calculation model, characterized in that: The method comprises: Based on the variance function and the mean function, construct the variational autoencoder to be trained; Under the condition that the output value of the variance function is set to a constant, the first stage training is performed on the variational autoencoder to be trained, and at the end of the first stage training, each weight of the mean function is obtained; Under the condition that each weight of the mean function remains unchanged, the variational autoencoder trained in the first stage is trained in the second stage, and at the end of the second stage training, each weight of the variance function is obtained; While keeping the obtained weights of the mean function and the variance function unchanged, the parameter values ​​of the randomized manifold space are learned, and the parameter values ​​of the randomized manifold space are used for data generation.

2. The training method of the manifold geodesic calculation model according to claim 1, characterized in that: The method of learning the parameter values ​​of the randomized manifold space while keeping the obtained weights of the mean function and the variance function unchanged includes: Under the condition that each weight of the mean function and each weight of the variance function remain unchanged, the parameter set of the cubic spline curve is updated by using the parameter set optimization formula; In the process of updating the parameter set of the cubic spline curve, a target parameter set is determined, where the target parameter set is a parameter set that enables the cubic spline curve to reach an optimal state in a latent variable space; Based on the target parameter set, obtaining a parameter set expression of the target cubic spline curve; The method further comprises: After the training of the second stage is completed, a reconstructed network is obtained based on each weight of the mean function and each weight of the variance function; Based on the reconstruction network, the target cubic spline curve is mapped to the generation space, so that the distance between two given points is connected with the shortest distance in the generation space through the target cubic spline curve, and the relationship between the two given points is represented to complete the reconstruction and generation of the data.

3. The training method of the manifold geodesic calculation model according to claim 1, characterized in that: The parameter set optimization formula is: The method further comprises: * The update amount of the parameter set is calculated by taking derivatives and adopting the stochastic gradient descent method to obtain the target parameter set.

4. The training method of the manifold geodesic calculation model according to claim 1, characterized in that: The second stage training is performed on the variational autoencoder trained in the first stage while keeping the weights of the mean function unchanged, and at the end of the second stage training, the weights of the variance function are obtained, including: Establish a weighted Gaussian mixture model; characterizing the variance function based on the weighted Gaussian mixture model; Wherein, the weighted Gaussian mixture model is: K represents the number of Gaussian components in the weighted Gaussian mixture model, ci represents the mean and ∑ i represents the covariance of the i-th component, ω i represents the mixing coefficient, W g ∈R D represents the weight vector, and Z represents the latent variable.

5. The training method of the manifold geodesic calculation model according to claim 4, characterized in that: The method further comprises: The weight vector W of the weighted Gaussian mixture model is trained g ; In the weight vector W g After the training is completed, based on the weight vector W after the training is completed g , update the weights of the variance function.

6. The training method of the manifold geodesic calculation model according to claim 4, characterized in that: The method further comprises: Setting the covariance in the weighted Gaussian mixture model to a diagonal matrix; By log(σ 2 (z)) to obtain the output value of the variance function.

7. The training method of the manifold geodesic calculation model according to claim 1, characterized in that: The first stage training is performed on the variational autoencoder to be trained when the output value of the variance function is set to a constant, and at the end of the first stage training, each weight of the mean function is obtained, including: Setting the output value of the variance function to a constant; An output value of the mean function is obtained, and based on the output value of the mean function, it is determined whether each weight of the mean function has been updated.

8. A training device for a manifold geodesic calculation model, characterized in that: The device comprises: A construction module is used to construct a variational autoencoder to be trained based on the variance function and the mean function; A first-stage training module, used for performing first-stage training on the variational autoencoder to be trained while setting the output value of the variance function to a constant, and obtaining each weight of the mean function at the end of the first-stage training; A second-stage training module is used to perform second-stage training on the variational autoencoder trained in the first stage while keeping the weights of the mean function unchanged, and obtain the weights of the variance function at the end of the second-stage training; The learning module is used to learn the parameter values ​​of the randomized manifold space while keeping the obtained weights of the mean function and the variance function unchanged, and the parameter values ​​of the randomized manifold space are used for data generation.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the training method of the manifold geodesic calculation model according to any one of claims 1 to 7.

10. A computer-readable medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the training method of the manifold geodesic calculation model as described in any one of claims 1-7 is implemented.

Citation Information

Patent Citations

  • A training sample data expansion method and device based on a variational auto-encoder

    CN109886388A

  • Dense time-varying array construction method and system based on controllable variational auto-encoder

    CN116449305A

  • Geodesic line learning method based on Riemannian geometry prior

    CN117909623A

  • Learning energy-based model with variational auto-encoder as amortized sampler

    US20230169325A1

  • Device and method for training a variational autoencoder

    US20240095595A1