Continuous submerged space mapping model training method and device and electronic equipment
By combining the latent space projection network and the reconstruction neural network, and utilizing distribution parameters and continuity factors, the problem of the robot motion control data being unable to be continuously mapped in the latent space is solved, the continuity and operability of the motion control data are achieved, and the efficient learning and adjustment of the robot's movements are supported.
Patent Information
- Application Number
- CN202510423563.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-04
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-04-04
AI Technical Summary
In the prior art, during the motion control process of a robot or automated control system, the continuous changes in motion control data in the real space cannot be effectively mapped to the latent space, resulting in the robot being unable to restore its posture or causing mechanical failure.
A continuous latent space mapping model training method is adopted. By combining the latent space projection network and the reconstruction neural network, the distribution parameters and continuity factors are used to realize the continuous mapping between motion state data and latent space variables, and the network parameters are adjusted to optimize the model training.
A continuous mapping between motion state data and latent space variables is achieved, ensuring the continuity and operability of motion control data and supporting efficient learning and adjustment of robot movements.
Smart Images

Figure CN120706488A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of deep learning technology, motion control technology, and latent space mapping technology, and in particular to a continuous latent space mapping model training method, device, and electronic equipment. Background Art
[0002] In recent years, with the development of artificial intelligence technology, it has shown great potential in complex task processing, autonomous learning, predictive maintenance, decision-making efficiency and accuracy. Therefore, various industries are trying to solve problems in their respective fields by introducing artificial intelligence technologies such as neural networks.
[0003] The data that artificial intelligence can process is usually vector data, so the conventional practice is to convert industry data into vector data through certain methods, and then provide it to artificial intelligence algorithms for further processing.
[0004] In existing technologies, latent space mapping can be used to achieve the conversion between industry data and vector data. Latent space mapping compresses complex high-dimensional data into a low-dimensional latent space through a deep learning model, retaining key features and removing redundant information.
[0005] However, using this approach often encounters problems when processing motion control planning and posture control for robots or other automated control systems. The main problem is that the motion control data of the robot system in real space is usually continuously changing, and its movements in space will form a continuous trajectory. However, due to the nonlinear characteristics of neural networks, these motion control data will form discrete vector points after being mapped into latent space vectors through neural networks, which is not continuous.
[0006] Similarly, converting the continuously changing vectors in the latent space into robot motion control data in the real space is also discontinuous, which will cause state jumps. The consequence is that the robot cannot restore the posture or complete the movement. In serious cases, it may even cause mechanical failure or motor damage. Summary of the Invention
[0007] The embodiments of the present application provide a continuous latent space mapping model training method, device and electronic device to solve the problem that continuous latent space mapping cannot be achieved in the prior art.
[0008] The present invention provides a method for training a continuous latent space mapping model, including:
[0009] Obtain the original motion state data used for this training;
[0010] Inputting the original motion state data into a latent space projection network to be trained, obtaining distribution parameters output by the latent space projection network, wherein the distribution parameters are parameters used to represent the posterior distribution of latent space variables, the posterior distribution of the latent space variables satisfies a preset distribution type, and the posterior distribution of the latent space variables represents the distribution of the latent space variables when the motion state data is the original motion state data;
[0011] Sampling the posterior distribution of the latent space variables represented by the distribution parameters to obtain a plurality of latent space variables;
[0012] Inputting the plurality of latent space variables into a reconstruction neural network to be trained respectively, and obtaining reconstructed motion state data output by the reconstruction neural network for each of the latent space variables;
[0013] Taking the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function, calculating the loss function, and obtaining an output value of the loss function;
[0014] Based on the output value of the loss function, network parameters of the latent space projection network and the reconstruction neural network are adjusted.
[0015] Furthermore, the distribution parameters include expected latent variables and continuity factors, wherein the expected latent variables represent latent space variables corresponding to the original motion state data, and the continuity factors represent the degree of influence of the motion state represented by the original motion state data on the surrounding motion states;
[0016] The posterior distribution of the latent space variable is a Gaussian distribution, which is expressed by the following formula:
[0017] q(z|x)=N(μ q (x),δ q 2 (x));
[0018] Among them, x represents the original motion state data, z represents the latent space variable, q(z|x) represents the posterior distribution of the latent space variable, μ q (x) represents the expected latent variable obtained when the input is the original motion state data x, δ q (x) represents the continuity factor obtained when the input is the original motion state data x.
[0019] Furthermore, taking the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function and calculating the loss function includes:
[0020] The distribution parameters, multiple reconstructed motion state data, and a preset motion continuity weight are used as inputs of a loss function to calculate the loss function, wherein, the larger the motion continuity weight is, the better the motion continuity of the latent space projection network is, and the worse the reconstruction accuracy of the reconstructed neural network is; the smaller the motion continuity weight is, the worse the motion continuity of the latent space projection network is, and the better the reconstruction accuracy of the reconstructed neural network is.
[0021] Furthermore, the step of using the distribution parameter, the plurality of reconstructed motion state data, and a preset motion continuity weight as inputs of a loss function to calculate the loss function includes:
[0022] The loss function is calculated using the following formula:
[0023] Loss = βK`-E;
[0024]
[0025] P(x|z)=N(μ p (z),δ p 2 (z));
[0026]
[0027] Among them, Loss is the output value of the loss function, β is the motion continuity weight, and k is the expected latent variable μ q The dimension, μ qi is the expected latent variable μ q The i-th element of δ qi is the continuity factor δ q The i-th element of , P(x|z) is the posterior distribution of the motion state data calculated based on the fitting of the multiple reconstructed motion states, which represents the posterior distribution of the motion state data when the latent space variable is a certain value, l is the number of times the posterior distribution of the latent space variable is sampled, is the i-th sampling value from the standard normal distribution.
[0028] Furthermore, the motion continuity weight has a value range of 0.1-10;
[0029] During the training process of the latent space projection network and the reconstruction neural network, the values of the motion continuity weights generally follow a trend from small to large, or a trend from large to small.
[0030] Furthermore, the latent space projection network is a multi-layer perceptron MLP network, or a convolutional neural network, and the reconstruction neural network is an MLP network, or a convolutional neural network.
[0031] The present invention provides a continuous latent space mapping model training device, comprising:
[0032] A data acquisition module is used to obtain the original motion state data used for this training;
[0033] a projection network module, configured to input the original motion state data into a latent space projection network to be trained, and obtain distribution parameters output by the latent space projection network, wherein the distribution parameters are parameters used to represent the posterior distribution of latent space variables, the posterior distribution of the latent space variables satisfies a preset distribution type, and the posterior distribution of the latent space variables represents the distribution of the latent space variables when the motion state data is the original motion state data;
[0034] a sampling module, configured to sample the posterior distribution of the latent space variables represented by the distribution parameters to obtain a plurality of latent space variables;
[0035] A reconstruction network module, configured to input the plurality of latent space variables into a reconstruction neural network to be trained, respectively, to obtain reconstructed motion state data output by the reconstruction neural network for each of the latent space variables;
[0036] a loss function calculation module, configured to use the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function, calculate the loss function, and obtain an output value of the loss function;
[0037] A network parameter adjustment module is used to adjust the network parameters of the latent space projection network and the reconstruction neural network based on the output value of the loss function.
[0038] Furthermore, the distribution parameters include expected latent variables and continuity factors, wherein the expected latent variables represent latent space variables corresponding to the original motion state data, and the continuity factors represent the degree of influence of the motion state represented by the original motion state data on the surrounding motion states;
[0039] The posterior distribution of the latent space variable is a Gaussian distribution, which is expressed by the following formula:
[0040] q(z|x)=N(μ q (x),δ q 2 (x));
[0041] Among them, x represents the original motion state data, z represents the latent space variable, q(z|x) represents the posterior distribution of the latent space variable, μ q (x) represents the expected latent variable obtained when the input is the original motion state data x, δ q (x) represents the continuity factor obtained when the input is the original motion state data x.
[0042] Furthermore, the loss function calculation module is specifically used to use the distribution parameters and multiple reconstructed motion state data, as well as a preset motion continuity weight as input of the loss function to calculate the loss function, wherein, the larger the motion continuity weight is, the better the motion continuity of the latent space projection network is, and the worse the reconstruction accuracy of the reconstructed neural network is; the smaller the motion continuity weight is, the worse the motion continuity of the latent space projection network is, and the better the reconstruction accuracy of the reconstructed neural network is.
[0043] Furthermore, the loss function calculation module is specifically configured to calculate the loss function using the following formula:
[0044] Loss = βk`-P;
[0045]
[0046] P(x|z)=N(μ p (z),δ p 2 (z));
[0047]
[0048] Among them, Loss is the output value of the loss function, β is the motion continuity weight, and k is the expected latent variable μ q The dimension, μ qi is the expected latent variable μ q The i-th element of δ qi is the continuity factor δ q The i-th element of , P(x|z) is the posterior distribution of the motion state data calculated based on the fitting of the multiple reconstructed motion states, which represents the posterior distribution of the motion state data when the latent space variable is a certain value, l is the number of times the posterior distribution of the latent space variable is sampled, is the i-th sampling value from the standard normal distribution.
[0049] Furthermore, the motion continuity weight has a value range of 0.1-10;
[0050] During the training process of the latent space projection network and the reconstruction neural network, the values of the motion continuity weights generally follow a trend from small to large, or a trend from large to small.
[0051] Furthermore, the latent space projection network is a multi-layer perceptron MLP network, or a convolutional neural network, and the reconstruction neural network is an MLP network, or a convolutional neural network.
[0052] An embodiment of the present application also provides an electronic device, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement any of the above-mentioned continuous latent space mapping model training methods.
[0053] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any of the above-mentioned continuous latent space mapping model training methods.
[0054] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described continuous latent space mapping model training methods.
[0055] The beneficial effects of this application include:
[0056] In the method provided in the embodiment of the present application, the network to be trained includes a latent space projection network and a reconstruction neural network, wherein the input of the latent space projection network is the original motion state data, and the output is the distribution parameter used to represent the posterior distribution of the latent space variable. The input of the reconstruction neural network is the latent space variable obtained by sampling the posterior distribution of the latent space variable, and the output is the reconstructed motion state data. The latent space projection network and the reconstruction neural network both belong to the latent space mapping model. During the model training process, the obtained distribution parameter and the reconstructed motion state data are used as the coefficients of the loss function to obtain the output value of the loss function, and the network parameters of the latent space projection network and the reconstruction neural network are adjusted based on the output value, thereby completing the training of the latent space mapping model. Compared with the prior art, the method provided in the embodiment of the present application obtains the posterior distribution of the latent space variable that can represent the continuity of the latent space variable during the model training process, and further uses the obtained posterior distribution of the latent space variable to realize effective training of the reconstructed neural network, thereby realizing a continuous latent space mapping between the motion state data and the latent space variable.
[0057] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0059] Figure 1Flowchart of the continuous latent space mapping model training method provided in an embodiment of the present application;
[0060] Figure 2 One of the schematic diagrams of training using the continuous latent space mapping model training method provided in an embodiment of the present application;
[0061] Figure 3 The second schematic diagram of training using the continuous latent space mapping model training method provided in an embodiment of the present application;
[0062] Figure 4 A schematic diagram of the structure of a continuous latent space mapping model training device provided in an embodiment of the present application;
[0063] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to provide an implementation scheme for continuous latent space mapping between motion state data and latent space variables, the embodiments of the present application provide a continuous latent space mapping model training method, device, and electronic device. The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not intended to limit the present application. In addition, the embodiments and features in the embodiments of the present application can be combined with each other if there is no conflict.
[0065] The present invention provides a method for training a continuous latent space mapping model. Figure 1 Shown, including:
[0066] Step 11: Obtain the original motion state data used for this training;
[0067] Step 12: Input the original motion state data into the latent space projection network to be trained to obtain the distribution parameters output by the latent space projection network, where the distribution parameters are parameters used to represent the posterior distribution of the latent space variables. The posterior distribution of the latent space variables satisfies a preset type distribution, and the posterior distribution of the latent space variables represents the distribution of the latent space variables when the motion state data is the original motion state data.
[0068] Step 13: sampling the posterior distribution of the latent space variables represented by the distribution parameters to obtain multiple latent space variables;
[0069] Step 14: Input the multiple latent space variables into the reconstruction neural network to be trained respectively, and obtain the reconstructed motion state data output by the reconstruction neural network for each latent space variable;
[0070] Step 15: using the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function, calculating the loss function, and obtaining an output value of the loss function;
[0071] Step 16: Based on the output value of the loss function, adjust the network parameters of the latent space projection network and the reconstruction neural network.
[0072] By adopting the above-mentioned continuous latent space mapping model training method provided in the embodiment of the present application, a posterior distribution of latent space variables that can represent the continuity of latent space variables is obtained during the model training process, and the obtained posterior distribution of latent space variables is further used to realize effective training of the reconstructed neural network, thereby realizing continuous latent space mapping between motion state data and latent space variables.
[0073] Furthermore, by utilizing the trained latent space projection network and the reconstructed neural network, the continuity and operability of motion control data in the latent space can be achieved, providing strong support for motion learning, generation, and adjustment of the controlled object.
[0074] The method provided in this application is described in detail below with reference to specific embodiments in conjunction with the accompanying drawings.
[0075] like Figure 2 As shown, it is a schematic diagram of training using the continuous latent space mapping model training method provided by an embodiment of the present application, wherein the network to be trained includes a latent space projection network Proj and a reconstruction neural network R, wherein the input of the latent space projection network Proj is the original motion state data, and the output is the distribution parameter used to represent the posterior distribution of the latent space variable, the input of the reconstruction neural network R is the latent space variable obtained by sampling the posterior distribution of the latent space variable, and the output is the reconstructed motion state data, the latent space projection network Proj and the reconstruction neural network R both belong to the latent space mapping model, and during the model training process, the obtained distribution parameters and the reconstructed motion state data are used as the coefficients of the loss function to obtain the output value of the loss function, and the network parameters of the latent space projection network Proj and the reconstruction neural network R are adjusted based on the output value, thereby completing the training of the latent space mapping model.
[0076] The reconstruction neural network R can convert latent space variables into reconstructed motion state data. Its network type can be an MLP (multi-layer perceptron) network or a convolutional neural network. Training the reconstruction neural network R requires latent space variables as input. However, the actual situation is that only the actual motion state data can be observed, and the corresponding latent space variable values cannot be obtained. In other words, there is no input data available for training for the reconstruction neural network R, and of course training cannot be performed.
[0077] Therefore, in an embodiment of the present application, it is proposed to use a latent space projection network Proj to generate latent space data, that is, latent space variables. Through the latent space projection network Proj, the motion state data in reality can be projected into latent space variables, so that a series of corresponding motion state data and latent space variables can be obtained for training the above-mentioned reconstruction neural network R. The latent space projection network Proj can adopt an MLP network or a convolutional neural network.
[0078] However, the latent space projection network Proj is also unknown, so it is impossible to obtain the corresponding latent space variables from the actual motion state data. Therefore, in an embodiment of the present application, it is proposed to merge the latent space projection network Proj and the reconstruction neural network R for training together. According to the collected original motion state data, it is used as the input of the latent space projection network Proj to obtain the latent space variables output by the latent space projection network Proj, and then the latent space variables are used as the input of the reconstruction neural network R to obtain the reconstructed motion state data output by the reconstructed neural network R. Based on the difference between the original motion state data and the reconstructed motion state data, the network parameters of the latent space projection network Proj and the reconstruction neural network R are updated, thereby achieving the simultaneous completion of the model training of the latent space projection network Proj and the reconstruction neural network R.
[0079] If the output of the latent space projection network Proj is only the latent space variables, then the output is still finite and discrete, and it is impossible to restore continuous motion states through this network. For example, for a robot, the motion state data of its standing state is recorded as x1, and the corresponding latent space variable is z1. The motion state data of its squatting state is recorded as x2, and the corresponding latent space variable is z2. Through training with a large amount of such data, it is indeed possible to restore the standing or squatting state based on z1 or z2. However, when trying to restore the intermediate state of half standing and half squatting based on z1.5 = (z1 + z2) / 2, due to the nonlinear characteristics of the neural network, it is very likely to obtain a lying state or other unknown state, which is inconsistent with the originally desired effect.
[0080] This abnormal situation can be alleviated by continuing to collect more intermediate motion state data such as half-standing and half-squatting for training. However, according to common sense, the motion state in the real world is continuous. There can be infinite intermediate states between any two discrete states. It is impossible to enumerate all states, and we can only cover them as much as possible. The problem this brings is that on the one hand, the amount of data required for training is extremely large, and on the other hand, even with a lot of training, it is still difficult to ensure the continuity of motion, and jitter and sluggishness will occur in the actual control process.
[0081] In order to solve the above problems, the latent space projection network Proj proposed in the embodiment of the present application no longer outputs a distribution parameter that represents only a latent space variable, but represents the posterior distribution of the latent space variable that satisfies a preset distribution type.
[0082] In one embodiment of the present application, the distribution parameters output by the latent space projection network Proj may include an expected latent variable and a continuity factor, wherein the expected latent variable represents the latent space variable corresponding to the original motion state data, and the continuity factor represents the degree of influence of the motion state represented by the original motion state data on the surrounding motion state;
[0083] The posterior distribution of the latent space variable can be a Gaussian distribution, that is, for any motion state data in the real space, the posterior distribution of the corresponding continuous latent space variable in the latent space is set to a Gaussian distribution, which can be specifically expressed by the following formula:
[0084] q(z|x)=N(μ q (x),δ q 2 (x));
[0085] Among them, x represents the original motion state data, z represents the latent space variable, q(z|x) represents the posterior distribution of the latent space variable, μ q (x) represents the expected latent variable obtained when the input is the original motion state data x, δ q (x) represents the continuity factor obtained when the input is the original motion state data x.
[0086] For the posterior distribution of the above latent space variables, the expected latent variable μ q (i.e. μ q (x)) can be understood as the latent space variable corresponding to the original motion state data, and the continuity factor δ q (i.e. δ q (x)) is used to characterize the degree of influence of this motion state on the surrounding motion state, and the expected latent variable μ q and continuity factor δ q It is determined by the latent space projection network Proj. In this way, during the training process, the latent space projection network Proj not only learns the discrete correspondence between the real space and the latent space, but also learns the influence of the current motion state on the surrounding untrained intermediate states through the continuity factor.
[0087] At this time, the two motion state data x1 and x2 are passed through the latent space projection network Proj to obtain two latent space variables z1 and z2 (i.e. μ q1 and μ q2 ), when the two latent space variables z1 and z2 are intermediate, because z1 and z2 have corresponding δ q1 and δq2 , each forming a probability distribution q1 and q2 covering the entire latent space, so the intermediate value will show the effect of superposition of two probability distributions, in this way, a smooth mapping relationship from continuous real space to continuous latent space is achieved.
[0088] Regarding step 15, the distribution parameters and the plurality of reconstructed motion state data are used as inputs of the loss function, the loss function is calculated, and the output value of the loss function is obtained. In the embodiment of the present application, Figure 3 As shown, the specific steps can be performed as follows:
[0089] The distribution parameters, multiple reconstructed motion state data, and preset motion continuity weights are used as inputs of the loss function to calculate the loss function, wherein the larger the motion continuity weight, the better the motion continuity of the latent space projection network, and the worse the reconstruction accuracy of the reconstructed neural network; the smaller the motion continuity weight, the worse the motion continuity of the latent space projection network, and the better the reconstruction accuracy of the reconstructed neural network.
[0090] In one embodiment of the present application, the loss function can be calculated using the following formula:
[0091] Loss = βK`-E;
[0092]
[0093] P(x|z)=N(μ p (z),δ p 2 (z));
[0094]
[0095] Among them, Loss is the output value of the loss function, β is the motion continuity weight, and k is the expected latent variable μ q The dimension, μ qi is the expected latent variable μ q The i-th element of δ qi is the continuity factor δ q The i-th element of , P(x|z) is the posterior distribution of the motion state data calculated based on the fitting of the multiple reconstructed motion states, which represents the posterior distribution of the motion state data when the latent space variable is a certain value, l is the number of times the posterior distribution of the latent space variable is sampled, is the i-th sampling value from the standard normal distribution.
[0096] Furthermore, the value range of the motion continuity weight β can be 0.1-10;
[0097] During the training process of the latent space projection network and the reconstruction neural network, the values of the motion continuity weights generally follow a trend from small to large, or a trend from large to small.
[0098] For example, the value of the motion continuity weight is adjusted once every predetermined number of trainings. The motion continuity weight starts at 0.1 and increases by 0.1 each time it is adjusted.
[0099] To facilitate understanding of the loss function represented by the above formula, the derivation process of the above loss function is described as follows:
[0100] The above-mentioned embodiments of the present application Figure 2 The latent space projection network Proj and the reconstruction neural network R shown in the figure complete the mapping from motion state data to the posterior distribution of latent space variables. Moreover, when any motion state data x is given, the corresponding posterior distribution of latent space variables is q(z|x)=N(μ q (x),δ q 2 (x)), rather than a discrete point.
[0101] For the reconstruction neural network R, if we want to reconstruct the prior distribution P(x) of the motion state data x from the prior distribution P(z) of the latent space variable z, according to the Gaussian mixture model, given any continuous distribution P(z), there is P(x|z) such that P(x)=∫P(z)P(x|z)dz;
[0102] Where P(x|z)=N(μ p (z),δ p 2 (z)), represents the posterior distribution of the motion state data x when the latent space variable is a certain value z;
[0103] At this time, if we want to reconstruct the probability P(x) of the motion state data x as large as possible, that is, to maximize logP(x).
[0104] Note:
[0105]
[0106] Among them, P(z,x) represents the probability of the latent space variable z and the motion state data x occurring simultaneously, and P(z|x) represents the likelihood function of the latent space variable z given the reconstructed motion state data x.
[0107] make
[0108]
[0109] Then logP(x)=L+K≥L
[0110] At this time, for any given continuous distribution P(z), if the neural network R is fixed and reconstructed, that is, P(x|z) is fixed, then P(x) is also fixed, and the value of logP(x) is fixed, then L and K are in a relationship of increase and decrease.
[0111] According to Bayes' theorem: P(z|x)=P(x|z)P(z) / P(x) is also fixed, only q(z|x) can be changed.
[0112] Now we just need to adjust the continuity factor δ q and the expected latent variable μ q , we can change the distribution q(z|x)=N(μ q (x),δ q 2 (x)), and then change the values of L and K. The smaller K is, the larger L is. Therefore, no matter how P(x) changes, we only need to keep adjusting the continuity factor δ q and the expected latent variable μ q , let q(z|x)=P(z|x), then K=0, we can get the maximum value of L, Lmax=logP(x), and logP(x)>=L, so solving the maximum value of logP(x) is equivalent to solving the maximum value of L.
[0113] and
[0114]
[0115] make
[0116]
[0117] E=∫q(z|x)logP(x|z)dz
[0118] Then L=EK`, so finding the maximum value of L is equivalent to finding the minimum value of K` and the maximum value of E.
[0119] and
[0120]
[0121] Where q(z|x)=N(μ q (x),δ q 2 (x)), so -∫q(z|x)log q (z|x)dz is actually a Gaussian distribution N(μ q (x),δ q 2 (x)), assuming that the dimension of the latent space vector is k, then
[0122]
[0123] Note that the above derivation process is applicable to any continuous distribution P(z). When P(z) = N(0, I), N(0, I) represents the standard normal distribution.
[0124]
[0125] Among them, μ qi is the expected latent variable μ q The i-th element of δ qi is the continuity factor δ q The i-th element of .
[0126] so Obviously, when δ qi =1 when it reaches its minimum value.
[0127] and
[0128] make Then φ conforms to the standard normal distribution N(0,I), μ p That is μ p (z), δ p That is δ p (z).
[0129] Through the Monte Carlo estimation method, we have
[0130]
[0131] in, is the i-th sampling value from the standard normal distribution.
[0132] It is obvious that under the condition of given z, μ q =μ p And δ q = 0, E reaches its maximum value, which means that the reconstructed neural network R can restore the original motion state data x to the greatest extent. However, at this time, the continuity factor δ q If K` is 0, the motion state will completely lose continuity, which is obviously not the desired result. In order to minimize K`, we need to let δ q When ρ is 1, the latent space projection network Proj can obtain a latent space vector distribution with good continuity. However, the ability of the reconstructed neural network R to accurately restore the action will be reduced.
[0133] Therefore, a trade-off can be made between motion continuity and reconstruction accuracy. To this end, the loss function of the entire network is set as follows:
[0134] Loss = βK`-E;
[0135] Among them, β is the weight used to adjust the continuity and reconstruction accuracy, which is called the motion continuity weight. The larger β is, the better the motion continuity of the latent space projection network Proj is, and the worse the reconstruction accuracy of the reconstruction neural network R is. The smaller β is, the worse the motion continuity of the latent space projection network Proj is, and the better the reconstruction accuracy of the reconstruction neural network R is.
[0136] How to determine the value of β depends on the specific motion requirements. For example, for a robot grasping action sequence, it is obviously necessary to be able to have an accurate posture at the final grasping moment, that is, a smaller β is required. The process of reaching out and gradually moving near the object pays more attention to the continuity of the action, that is, a larger β is required.
[0137] By adopting the above-mentioned continuous latent space mapping model training method provided in the embodiment of the present application, a posterior distribution of latent space variables that can represent the continuity of latent space variables is obtained during the model training process, and the obtained posterior distribution of latent space variables is further used to realize effective training of the reconstructed neural network, thereby realizing continuous latent space mapping between motion state data and latent space variables.
[0138] The realization of continuous latent space mapping enables efficient representation, processing, and optimization of the motion of controlled moving objects (such as robots). This ensures the continuity and operability of motion control data for the controlled moving object in the latent space, providing strong support for motion learning, generation, and adjustment of the controlled moving object.
[0139] Based on the same inventive concept, according to the continuous latent space mapping model training method provided in the above embodiment of the present application, correspondingly, another embodiment of the present application also provides a continuous latent space mapping model training device, whose structural diagram is shown in FIG. Figure 4 As shown, specifically including:
[0140] The data acquisition module 41 is used to acquire the original motion state data used for this training;
[0141] a projection network module 42 for inputting the original motion state data into a latent space projection network to be trained, and obtaining distribution parameters output by the latent space projection network, wherein the distribution parameters are parameters for representing a posterior distribution of latent space variables, the posterior distribution of the latent space variables satisfying a preset distribution type, and the posterior distribution of the latent space variables representing the distribution of the latent space variables when the motion state data is the original motion state data;
[0142] a sampling module 43 for sampling the posterior distribution of the latent space variables represented by the distribution parameters to obtain a plurality of latent space variables;
[0143] A reconstruction network module 44 is configured to input the plurality of latent space variables into a reconstruction neural network to be trained, respectively, to obtain reconstructed motion state data output by the reconstruction neural network for each of the latent space variables;
[0144] a loss function calculation module 45, configured to use the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function, calculate the loss function, and obtain an output value of the loss function;
[0145] The network parameter adjustment module 46 is used to adjust the network parameters of the latent space projection network and the reconstruction neural network based on the output value of the loss function.
[0146] Furthermore, the distribution parameters include expected latent variables and continuity factors, wherein the expected latent variables represent latent space variables corresponding to the original motion state data, and the continuity factors represent the degree of influence of the motion state represented by the original motion state data on the surrounding motion states;
[0147] The posterior distribution of the latent space variable is a Gaussian distribution, which is expressed by the following formula:
[0148] q(z|x)=N(μ q (x),δ q 2 (x));
[0149] Among them, x represents the original motion state data, z represents the latent space variable, q(z|x) represents the posterior distribution of the latent space variable, μ q (x) represents the expected latent variable obtained when the input is the original motion state data x, δ q (x) represents the continuity factor obtained when the input is the original motion state data x.
[0150] Furthermore, the loss function calculation module 45 is specifically used to use the distribution parameters and the multiple reconstructed motion state data, as well as the preset motion continuity weight as inputs of the loss function to calculate the loss function, wherein the larger the motion continuity weight is, the better the motion continuity of the latent space projection network is, and the worse the reconstruction accuracy of the reconstructed neural network is; the smaller the motion continuity weight is, the worse the motion continuity of the latent space projection network is, and the better the reconstruction accuracy of the reconstructed neural network is.
[0151] Furthermore, the loss function calculation module 45 is specifically configured to calculate the loss function using the following formula:
[0152] Loss = βK`-E;
[0153]
[0154] P(x|z)=N(μ p (z),δ p 2 (z));
[0155]
[0156] Among them, Loss is the output value of the loss function, β is the motion continuity weight, and k is the expected latent variable μ q The dimension, μ qi is the expected latent variable μ q The i-th element of δ qi is the continuity factor δ q The i-th element of , P(x|z) is the posterior distribution of the motion state data calculated based on the fitting of the multiple reconstructed motion states, which represents the posterior distribution of the motion state data when the latent space variable is a certain value, l is the number of times the posterior distribution of the latent space variable is sampled, is the i-th sampling value from the standard normal distribution.
[0157] Furthermore, the motion continuity weight has a value range of 0.1-10;
[0158] During the training process of the latent space projection network and the reconstruction neural network, the values of the motion continuity weights generally follow a trend from small to large, or a trend from large to small.
[0159] Furthermore, the latent space projection network is a multi-layer perceptron MLP network, or a convolutional neural network, and the reconstruction neural network is an MLP network, or a convolutional neural network.
[0160] The functions of the above modules can correspond to Figure 1 The corresponding processing steps in the shown process will not be repeated here.
[0161] The continuous latent space mapping model training device provided in the embodiments of the present application can be implemented via a computer program. Those skilled in the art will appreciate that the aforementioned module division is only one of many module division methods, and that other module divisions or no module divisions, as long as the continuous latent space mapping model training device has the aforementioned functions, are within the scope of protection of the present application.
[0162] The present application also provides an electronic device, such as Figure 5 As shown, it includes a processor 51 and a machine-readable storage medium 52, wherein the machine-readable storage medium 52 stores machine-executable instructions that can be executed by the processor 51, and the processor 51 is prompted by the machine-executable instructions to implement any of the above-mentioned continuous latent space mapping model training methods.
[0163] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any of the above-mentioned continuous latent space mapping model training methods.
[0164] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described continuous latent space mapping model training methods.
[0165] The machine-readable storage medium in the electronic device may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may be at least one storage device located remote from the processor.
[0166] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0167] Each embodiment in this specification is described in a related manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device, electronic device, computer-readable storage medium, and computer program product embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.
[0168] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device 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 device. 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 device comprising the element.
[0169] The present application is described with reference to the flowcharts and / or block diagrams of the methods, 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 device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. 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.
[0170] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0172] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A continuous latent space mapping model training method, characterized in that: include: Obtain the original motion state data used for this training; Inputting the original motion state data into a latent space projection network to be trained, obtaining distribution parameters output by the latent space projection network, wherein the distribution parameters are parameters used to represent the posterior distribution of latent space variables, the posterior distribution of the latent space variables satisfies a preset distribution type, and the posterior distribution of the latent space variables represents the distribution of the latent space variables when the motion state data is the original motion state data; Sampling the posterior distribution of the latent space variables represented by the distribution parameters to obtain a plurality of latent space variables; Inputting the plurality of latent space variables into a reconstruction neural network to be trained respectively, and obtaining reconstructed motion state data output by the reconstruction neural network for each of the latent space variables; Taking the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function, calculating the loss function, and obtaining an output value of the loss function; Based on the output value of the loss function, network parameters of the latent space projection network and the reconstruction neural network are adjusted.
2. The method according to claim 1, wherein The distribution parameters include expected latent variables and continuity factors, wherein the expected latent variables represent latent space variables corresponding to the original motion state data, and the continuity factors represent the degree of influence of the motion state represented by the original motion state data on the surrounding motion states; The posterior distribution of the latent space variable is a Gaussian distribution, which is expressed by the following formula: q(z|x)=N(μ q (x),δ q 2 (x)); Among them, x represents the original motion state data, z represents the latent space variable, q(z|x) represents the posterior distribution of the latent space variable, μ q (x) represents the expected latent variable obtained when the input is the original motion state data x, δ q (x) represents the continuity factor obtained when the input is the original motion state data x.
3. The method according to claim 2, wherein The step of using the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function and calculating the loss function comprises: The distribution parameters, multiple reconstructed motion state data, and a preset motion continuity weight are used as inputs of a loss function to calculate the loss function, wherein, the larger the motion continuity weight is, the better the motion continuity of the latent space projection network is, and the worse the reconstruction accuracy of the reconstructed neural network is; the smaller the motion continuity weight is, the worse the motion continuity of the latent space projection network is, and the better the reconstruction accuracy of the reconstructed neural network is.
4. The method according to claim 3, wherein The step of using the distribution parameter, the plurality of reconstructed motion state data, and a preset motion continuity weight as inputs of a loss function and calculating the loss function comprises: The loss function is calculated using the following formula: Loss = βK`-E; Among them, Loss is the output value of the loss function, β is the motion continuity weight, and k is the expected latent variable μ q The dimension, μ qi is the expected latent variable μ q The i-th element of δ qi is the continuity factor δ q The i-th element of , P(x|z) is the posterior distribution of the motion state data calculated based on the fitting of the multiple reconstructed motion states, which represents the posterior distribution of the motion state data when the latent space variable is a certain value, l is the number of times the posterior distribution of the latent space variable is sampled, is the i-th sampling value from the standard normal distribution.
5. The method according to claim 3 or 4, wherein: The value range of the motion continuity weight is 0.1-10; During the training process of the latent space projection network and the reconstruction neural network, the values of the motion continuity weights generally follow a trend from small to large, or a trend from large to small.
6. The method according to claim 1, wherein The latent space projection network is a multi-layer perceptron MLP network, or a convolutional neural network, and the reconstruction neural network is an MLP network, or a convolutional neural network.
7. A continuous latent space mapping model training device, characterized in that: include: A data acquisition module is used to obtain the original motion state data used for this training; a projection network module, configured to input the original motion state data into a latent space projection network to be trained, and obtain distribution parameters output by the latent space projection network, wherein the distribution parameters are parameters used to represent the posterior distribution of latent space variables, the posterior distribution of the latent space variables satisfies a preset distribution type, and the posterior distribution of the latent space variables represents the distribution of the latent space variables when the motion state data is the original motion state data; a sampling module, configured to sample the posterior distribution of the latent space variables represented by the distribution parameters to obtain a plurality of latent space variables; A reconstruction network module, configured to input the plurality of latent space variables into a reconstruction neural network to be trained, respectively, to obtain reconstructed motion state data output by the reconstruction neural network for each of the latent space variables; a loss function calculation module, configured to use the distribution parameter and the plurality of reconstructed motion state data as inputs of a loss function, calculate the loss function, and obtain an output value of the loss function; A network parameter adjustment module is used to adjust the network parameters of the latent space projection network and the reconstruction neural network based on the output value of the loss function.
8. The device according to claim 7, wherein The distribution parameters include expected latent variables and continuity factors, wherein the expected latent variables represent latent space variables corresponding to the original motion state data, and the continuity factors represent the degree of influence of the motion state represented by the original motion state data on the surrounding motion states; The posterior distribution of the latent space variable is a Gaussian distribution, which is expressed by the following formula: q(z|x)=N(μ q (x),δ q 2 (x)); Among them, x represents the original motion state data, z represents the latent space variable, q(z|x) represents the posterior distribution of the latent space variable, μ q (x) represents the expected latent variable obtained when the input is the original motion state data x, δ q (x) represents the continuity factor obtained when the input is the original motion state data x.
9. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Report-based data coding model generation method, system and device
CN111599431A
Method and apparatus for neural network based on energy-based latent variable model
CN116391193A
Boundary box distribution model training method and device and target detection method and device
CN117132754A
Bayesian variational auto-encoder model and establishment method and application thereof
CN118277797A
Marine environment short-term prediction method and system based on conditional adversarial network
CN118779582A