Method and apparatus for training a generative model
By predicting the solution of a PF-ODE at a starting timestep, the method enhances the efficiency and practicality of denoising diffusion bridge models, addressing the computational challenges of standard diffusion models in tasks with non-Gaussian priors.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- ROBERT BOSCH GMBH
- Filing Date
- 2024-10-17
- Publication Date
- 2026-04-23
AI Technical Summary
Standard diffusion models require hundreds of network evaluations for decent performance, hindering their practical deployment due to high computational demands, especially in tasks involving non-Gaussian prior distributions such as image translation.
A consistency function is introduced to predict the solution of a probability-flow ordinary differential equation (PF-ODE) at a starting timestep, allowing direct mapping from given endpoints, thus reducing the need for extensive network evaluations.
This approach significantly improves the sampling speed of denoising diffusion bridge models while retaining generative modeling capabilities, making them more practical for real-world applications.
Smart Images

Figure CN2024125470_23042026_PF_FP_ABST
Abstract
Description
METHOD AND APPARATUS FOR TRAINING A GENERATIVE MODELFIELD
[0001] Aspects of the present disclosure relate generally to artificial intelligence, and more particularly, to method and apparatus provided for training a generative model.BACKGROUND
[0002] Diffusion models (DMs) have exhibited outstanding capabilities in generative modeling in a variety of domains by learning stochastic processes from noise to data. But for many applications such as image editing, the model input may come from a distribution that is not random noise.
[0003] To this end, diffusion denoising bridge models (DDBMs) , a new family of generative models that build stochastic processes between fixed data endpoints based on a reference diffusion process have shown up, which have achieved empirical success across tasks with coupled data distribution, such as image translation, image inpainting, semantic interpolation, etc.
[0004] However, during inference phase, DDBM’s sampling process typically requires hundreds of network evaluations to achieve decent performance, even using an advanced high-order hybrid sampler, which may impede their practical deployment due to high computational demands. Therefore, an efficient and flexible method for accelerating the sampling process is expected.SUMMARY
[0005] The following presents a simplified summary of one or more aspects to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.
[0006] Diffusion models are a powerful class of generative models which learn to reverse a diffusion process mapping data to noise, which may be widely used in many scenarios such as image generation, audio synthesis, video generation, as well as image editing, etc. Despite these impressive results, standard diffusion models are ill-suited for other tasks. In particular, the diffusion framework assumes that the prior distribution is random noise, which makes it difficult to adapt to tasks such as image translation, where the goal is to map between pairs of images, in which scenario both endpoints are with an informative non-Gaussian prior.
[0007] To this end, an emergent family of generative models focuses on leveraging diffusion bridges, a series of altered diffusion processes conditioned on given endpoints are proposed, to model transport between two arbitrary distributions. Among them, denoising diffusion bridge models (DDBMs) study the reverse-time diffusion bridge conditioned on the terminal endpoint, showing superior performance in application with coupled data pairs such as distribution translation compared to diffusion models. However, DDBMs generally require hundreds of network evaluations to produce samples with decent quality, even using an advanced high-order hybrid sampler, potentially hindering their deployments in real-world applications.
[0008] The disclosure aims to address the aforementioned issues by learning a consistency function that directly predicts a solution of a probability-flow ordinary differential equation (PF-ODE) at a certain starting timestep given any points in the ODE trajectory, the PF-ODE describing the diffusion process of the DDBMs and can be used as the generative model, the consistency function is designed to be a one-step generator that directly maps from a given endpoint to data. The disclosed method could improve the sampling speed of DDBMs significantly and meanwhile retain the desirable properties of generative modeling.
[0009] In an aspect, a computer implemented method for training a first generative model is disclosed. The computer implemented method comprises obtaining a data pair from a training set, wherein the data pair comprises a first sample and a second sample, wherein the first sample and the second sample are deterministic; obtaining a first intermediate sample and a second intermediate sample at different time points along one trajectory transitioning between the first sample and the second sample; predicting, conditioned partially on the second sample, the first and the second intermediate samples directly at a starting time point of the trajectory respectively to obtain a first predicted sample and a second predicted sample; and optimizing the first generative model based at least on minimizing a distance between the first predicted sample and the second predicted sample.
[0010] In an aspect, a computer implemented method for generating a third sample from a fourth sample which is deterministic by the first generative model trained with any method herein is disclosed. The computer implemented method comprises sampling the fourth sample from a non-Gaussian distribution; obtaining a sample estimation via an initial evaluation of the trained first generative model; sampling a valid starting point for generating the third sample from a distribution conditioned on the fourth sample and the sample estimation; and generating the third sample by the trained first generative model from the valid starting point.
[0011] In an aspect, a computer system is disclosed. The computer system comprises one or more processors; and one or more storage devices storing computer-executable instructions that, when executed, cause the one or more processors to perform the operations of one of the methods disclosed herein.
[0012] In an aspect, one or more computer readable storage media storing computer-executable instructions that, when executed, cause one or more processors to perform the operations of one of the methods disclosed herein is disclosed.
[0013] In an aspect, a computer program product comprising computer-executable instructions that, when executed, cause one or more processors to perform the operations of one of the methods disclosed herein is disclosed.
[0014] In an aspect, an apparatus comprising one or more means for performing the operations of one of the methods disclosed herein is disclosed.BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The disclosed aspects will be described in connection with the appended drawings that are provided to illustrate and not to limit the disclosed aspects. The same reference numbers in different drawings may identify the same or similar elements.
[0016] Fig. 1 illustrates an example process 100 of a Diffusion Model (DM) , in accordance with various aspects of the present disclosure.
[0017] Fig. 2 illustrates an example architecture 200 of a DM for training, in accordance with various aspects of the present disclosure.
[0018] Fig. 3 illustrates an example process 300 of a Denoising Diffusion Bridge Model (DDBM) , in accordance with various aspects of the present disclosure.
[0019] Fig. 4 illustrates an example architecture 400 of a DDBM for training, in accordance with various aspects of the present disclosure.
[0020] Fig. 5 illustrates an example trajectory 500 of a consistency model on DDBM, in accordance with various aspects of the present disclosure.
[0021] Fig. 6 illustrates an example method 600 for training a generative model, in accordance with various aspects of the present disclosure.
[0022] Fig. 7 illustrates an example method 700 for generating a sample from another deterministic sample by a generative model, in accordance with various aspects of the present disclosure.
[0023] Fig. 8 illustrates an example computer system 800, in accordance with various aspects of the present disclosure.DETAILED DESCRIPTION
[0024] The present disclosure will now be discussed with reference to several example implementations. It is to be understood that these implementations are discussed only for enabling those skilled in the art to better understand and thus implement the embodiments of the present disclosure, rather than suggesting any limitations on the scope of the present disclosure.
[0025] Various embodiments will be described in detail with reference to the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts. References made to examples and embodiments are for illustrative purposes, and are not intended to limit the scope of the disclosure. It is noted that “based on” used in the disclosure should be understood as “based at least on” , rather than “solely based on” or “merely based on” .
[0026] It is anticipated that applying the disclosed method herein may involve the use of data from a variety of sources for training and / or sampling, such as images, audios, texts, etc. It should be noted that the use of data requires copyright holder or user authorization and may not exceed the scope of authorization.
[0027] Diffusion models (DMs) have presented impressive results on many generative tasks, to name a few, image generation, audio synthesis, video generation, as well as image editing. Fig. 1 illustrates an example process 100 of a Diffusion Model (DM) , in accordance with various aspects of the present disclosure. It is to be noted that Fig. 1 may be described mainly taking images as examples but not limiting, and other types of input and output are possible.
[0028] As shown in Fig. 1, for training, an image may be fed into the DM, and the DM can gradually inject noise into the clean representation x of the image from a data distribution pdata (x) by a fixed forward process, illustrated with solid arrows, and for T timesteps, the noisy data xT would be or at least approximate to a pure Gaussian noise. The forward process may be defined by a stochastic differential equation (SDE) : dxt=f (xt, t) dt+g (t) dwt, x0~p0 (1)
[0029] wherein wt is a standard Wiener process, and are drift and diffusion coefficients, respectively. As mentioned above, the terminal distribution pT is designed to approximate a tractable prior ppri0r (e.g., standard Gaussian) with the appropriate choice of f and g.
[0030] Then a reverse process illustrated with dashed arrows may be learned, which is to gradually remove noise from the noisy data xT to generate samples. The corresponding reverse SDE may be defined by:
[0031] And the probability flow ordinary differential equation (PF-ODE) of the forward SDE in Eq. 1 may be given by:
[0032] wherein is a reverse-time standard Wiener process and pt (xt) is the marginal distribution of xt. Either the reverse SDE in Eq. (2) or the PF-ODE in Eq. (3) can act as a generative model during inference, by sampling xT~pprior and simulating the trajectory from xT to x0.
[0033] In order to infer the trajectory from xT to x0, in both Eq. (2) and (3) , which is known as the score function, may be learned by a neural network during training. Fig. 2 illustrates an example architecture 200 of a DM for training, in accordance with various aspects of the present disclosure.
[0034] As shown in Fig. 2, similar to Fig. 1, an image may be fed into the neural network 210, represented by sθ (xt, t) with learnable parameters θ , which is to be trained to approximate the score function, the clean data x0 of the image follows a data distribution pdata (x) . A time step t may be uniformly sampled from {0, 1, …, T} , and then input to the neural network 210 together with the clean data x0 of the image. The neural network sθ (xt, t) may be learned by minimizing the denoising score matching (DSM) loss, defined by:
[0035] where is uniform distribution, λ (t) >0 is a weighting function, and p0 (x0) pt∣0 (xt∣x0) is the transition kernel from x0 to xt.
[0036] After training, the resulting score predictor sθ (xt, t) may be used to replace the true score function in Eq. (2) and (3) to obtain the empirical diffusion SDE and ODE, either can act as a generative model to generate an image starting from a random noise. In practice, the empirical diffusion SDE and ODE can be simulated by various SDE or ODE solvers. Empirically, the trained DM may be able to generate an image from a random noise.
[0037] Despite these impressive results, standard DMs as described with Fig. 1 are ill-suited for other tasks in addition to image generation. In particular, the diffusion framework assumes that the prior distribution is random noise which makes it difficult to adapt to tasks with given endpoints, such as image translation, where the goal is to map between pairs of images.
[0038] An emergent family of generative models focuses on leveraging diffusion bridges are proposed for this issue, diffusion bridge models such as denoising diffusion bridge models (DDBMs) , to model transport between two arbitrary distributions. Fig. 3 illustrates an example process 300 of a Denoising Diffusion Bridge Model (DDBM) , in accordance with various aspects of the present disclosure. It is to be noted that Fig. 3 may be described mainly taking semantic interpolation of images as examples but not limiting, and other application scenarios are possible.
[0039] Given a data pair sampled from an arbitrary unknown joint distribution (x, y) ~qdata (x, y) , and let x0=x. As shown in Fig. 3, an image of tiger may be sampled and represented as x, an image of dog may be sampled and represented as y. For training, it is desired that after T time steps, the image of tiger may be transitioned into the image of dog, rather than a noise, via a forward diffusion process illustrated with solid arrows.
[0040] A DDBM specify a forward stochastic process that ensures xT=y on a reference diffusion process in Eq (1) via: (x0, xT) = (x, y) ~qdata
[0041] wherein pT∣t (xT=y∣xt) is the transition kernel of the reference diffusion process from t to T, evaluated at xT=y. Denoting the marginal distribution of Eq (5) as it can be shown that the forward bridge SDE in Eq (5) is characterized by the diffusion distribution conditioned on both endpoints, that is, qt∣0T (xt∣x0, xT) =pt∣0T (xt∣x0, xT) , which is an analytic Gaussian distribution.
[0042] Therefore, a reverse process illustrated with dashed arrows to be learned as a generative model may be obtained by modeling qt∣0T (xt∣x0, xT) , whose reverse SDE and PF-ODE can be given by:
[0043] During inference, in order to infer the trajectory from xT to x0, the score function can be learned by a neural network during training. Fig. 4 illustrates an example architecture 400 of a DDBM for training, in accordance with various aspects of the present disclosure.
[0044] As shown in Fig. 4, a pair of images sampled from an arbitrary unknown joint distribution (x, y) ~qdata (x, y) corresponding to two endpoints may be fed into the neural network 410, represented by sθ (xt, t, y) with learnable parameters θ, which is to be trained to approximate the score function. A time step t may be uniformly sampled from {0, 1, …, T} , and then input to the neural network 410 together with the images. The neural network sθ (xt, t, y) may be learned by minimizing the denoising bridge score matching (DBSM) loss, defined by:
[0045] After training, replacing in Eq (6) and (7) with the learned score predictor sθ (xt, t, y) would yield the empirical bridge SDE and ODE that could be solved for generation purposes.
[0046] As mentioned above, DDBM’s sampling process typically requires hundreds of network evaluations to achieve decent performance, even using an advanced high-order hybrid sampler, which may impede their practical deployment due to high computational demands. It is disclosed herein a method to learn an efficient and flexible model that can be able to obtain the solution of the PF-ODE corresponding to the diffusion process at a starting time point, thus skip the process of hundreds of network evaluations for sampling.
[0047] In an embodiment, given a trajectory with a fixed starting timestep ε of a PF-ODE, a consistency model may be trained to learn the solution of the PF-ODE at t=ε , also known as the consistency function, defined as h: (xt, t) →x∈ . Therefore, a consistency model is disclosed herein to be trained on the DDBM to directly predict the solution of its corresponding PF-ODE, thereby bypassing the computation resource consuming sampling procedure.
[0048] Fig. 5 illustrates an example trajectory 500 of a consistency model on DDBM, in accordance with various aspects of the present disclosure.
[0049] In Fig. 5, the x axis represents a noise level of sample, and the y axis represents the time. Two ODE trajectories are shown in Fig. 5, wherein ODE1 illustrated with a dashed line corresponds to a DM, the trajectory ODE1 has one deterministic endpoint at t=0, and one non-deterministic endpoint at t=T usually obeys a pure Gaussian distribution, and the trajectory ODE1 may be defined by Eq (3) . Compared with ODE1, ODE2 in Fig. 5 which corresponds to a DDBM is illustrated with a solid line, it has two deterministic endpoints at t=0 and t=T, which obey non-Gaussian distributions respectively. The trajectory ODE2 may be defined by Eq (7) .
[0050] In the disclosure, a consistency function conditioned on two deterministic endpoints h:(xt, t, y) →x∈ is to be learned on the ODE trajectory of a diffusion bridge model to further boost its performance and sample efficiency, which may be called consistency diffusion bridge model, wherein ε is a fixed starting timestep of the PF-ODE and the goal is to learn the consistency function using a neural network hθ (·, ·, y) .
[0051] In an embodiment, as shown in Fig. 5, the neural network hθ (·, ·, y) may be trained by predicting two solutions at the starting timestep of the ODE trajectory from two intermediate time points xt and xr respectively, and updating the learnable parameters of the model based on minimizing a distance between the two predicted solutions. The high-level objective may be shown as following:
[0052] wherein hθ is the neural network to be learned with θ representing the learnable parameters, λ (t) is a positive weighting function, and d denotes a metric function to evaluate the distance between the predicted solutions. Also, r (t) is a function that specifies another time step r as a function of t.
[0053] Taking image inpainting as a specific example, a consistency diffusion bridge model may be learned on a diffusion bridge model such as DDBM for the task. A pair of images may be obtained from a training set, wherein an image may be a complete and clear one and another may be a corrupted version of the image with a lost part. The complete image may be used as the sample at t=0, and the corrupted one may be used as the sample at t=T. A trajectory that transitions between the two samples at t=0 and t=T may be obtained based on a DDBM, for example, the trajectory may be defined by Eq (7) .
[0054] In order to learn the consistency function, two intermediate time points and their corresponding intermediate samples may be obtained along the trajectory. For example, an intermediate time step t may be sampled from the uniform distribution over [∈, T] , and another intermediate time step r may be determined based on t as r=r (t) . Further, the intermediate sample at time step t may be obtained based on a forward diffusion process of DDBM starting from the sample at t=0 along one trajectory transitioning from the sample at t=0 to the sample at t=T, and the intermediate sample at time step r along the trajectory may also be obtained based on a forward diffusion process of DDBM. Alternatively, to ensure the two intermediate samples belongs to one same trajectory, the sample may be obtained based on a reverse diffusion process of DDBM if r<t as shown in Fig. 5, which can be done based on evaluation of the PF-ODE of DDBM starting from the sample at the intermediate time step t.
[0055] In an embodiment, the evaluation of the PF-ODE may be done by simulating the empirical diffusion ODE with a pre-trained score predictor to solve the empirical bridge ODE to obtain wherein is the update function of a one-step ODE solver with fixed And the training objective of Eq (9) may be further defined as:
[0056] In a further embodiment, the one-step ODE solver may be presented as below, with a lower local error. Given an initial value xt at time t, the first-order solver of the bridge ODE in Eq (7) from t to r∈ [0, t] may be:
[0057] wherein αt, ρt, may align with the common notation of noise schedules used in a variety of diffusion models by denoting σt=αtρt. The αt, ρt, may be defined as follow:
[0058] It is to be noted that although DDBM is used as an example diffusion bridge model, the disclosed method may apply to different diffusion bridge models by adopting a neater set of notations of noise schedule, to name a few, Brownian bridge, Diffusion bridge such as DDBM, image-to-image schrodinger bridge (I2SB) , text-to-speech schrodinger bridge (bridge-TTS) , etc. The example set of notations of noise schedule corresponding to different bridge models are shown below in Table 1.
[0059] Table 1. specifications of design space in different diffusion bridges
[0060] In another embodiment, the evaluation of the ODE may be done by estimating the score function by an unbiased score estimator as:
[0061] wherein given a single (x, y) ~qdata (x, y) and xt~qt∣0T (xt∣x0=x, xT=y) . Substituting such an estimation of into the one-step ODE solver in Eq (10) with the transformation between data and score predictor an alternative that does not rely on the pre-trained for any noise schedule taking the form in Eq (12) can be obtained as follows:
[0062] wherein ar , br and cr may be defined as below for DDBM with αt , ρt , coming from Eq (12) , and is a shared Gaussian noise used in hθ:
[0063] Based on the above instantiation of the training objective of Eq (9) may be further defined as:
[0064] wherein t, r, λ (t) are defined the same as Eq (9) .
[0065] In a further embodiment, the consistency function may be learned based on a online network hθ (·, ·, y) and a reference target network hθ- (·, ·, y) , wherein θ- refers to an exponential moving average of θ during training, which can be obtained with operation stopgrad as: θ-← stopgrad (μθ-+ (1-μ) θ) . Therefore, the training objective of Eq (10) and (16) may be further defined as:
[0066] As described above, the consistency function is disclosed to be learned on top of a denoising diffusion bridge model (DDBM) , so as to improve its sampling efficiency. Moreover, the consistency function can be learned on different types of bridge models other than DDBM with a unified set of notations of noise schedule in two ways: based on a pre-trained score predictor or trained directly with a score estimator, both of which are free of dependence on a restricted form of noise schedule, thus enhancing the practical versatility and extensibility of the framework.
[0067] After the consistency diffusion bridge model is trained, it may act as a generative model for different tasks, for example, image translation which aims at transferring an image into a certain style, image inpainting which aims at recovering a whole and clear image from a corrupted one, and semantic interpolation which may be able to transition between two unrelated images gradually and obtain a series of samples lying between the two source samples, etc.
[0068] In addition to images, the consistency diffusion bridge model may be applied to tasks associated with other types of input, such as texts or speeches. By transferring the inputs into any suitable form of feature embedding that may be processed by the model, the model may be trained to learn the transition between any arbitrary unknown data distributions.
[0069] During sampling process of inference, different than a diffusion model, the consistency diffusion bridge model holds a deterministic starting point for generating as xT=y, while the diffusion model starts from random noise. In order to make the trained consistency diffusion bridge model to produce x0~q0|T (x0|xT=y) in the desired way, a valid starting point may be obtained by the method disclosed hereinafter.
[0070] Taking a task of image translation as an example, an image may be sampled from y~qdata (y) and act as a starting sample for generating corresponding to time step T. In a first step, an estimate of the sample to be generated may be obtained by hθ(xT, T, y) based on the trained consistency function hθ. Then in a second step, a valid starting point of an ODE trajectory for generating may be sampled from qT-γ|0T(xT-γ|x0=hθ (xT, T, y) , xT=y) for some γ>0. In a third step, an image may be finally generated from xT-γ by x0=hθ(xT-γ, T-γ, y) .
[0071] In a further embodiment, a forward diffusion step and a consistency model evaluation step may be alternated one or more times to further improve sample quality. For example, after a sample x0=hθ(xT-γ, T-γ, y) is generated as described above, one or more intermediate time points t1…tN may be obtained between 0 and T. Then a forward diffusion step may be performed to obtain x1 from x0, for example according to Eq (5) , and a consistency model evaluation step may be performed to obtain x′0 from x1 , for example by x′0=hθ (x1, t1, y) and the two steps may be iterated for each intermediate time points t1…tN to obtain a more stable sample.
[0072] Fig. 6 illustrates an example method 600 for training a generative model, in accordance with various aspects of the present disclosure.
[0073] As described below, some or all illustrated features may be omitted in an implementation within the scope of the present disclosure, and some illustrated features may not be required for implementation of all embodiments. Further, some of the blocks may be performed parallel or in a different order.
[0074] The method begins at block 610, with obtaining a data pair from a training set, wherein the data pair comprises a first sample and a second sample, wherein the first sample and the second sample are deterministic.
[0075] In an embodiment, the data pair from the training set is one type of image, audio or text.
[0076] In an embodiment, each of the first sample and the second sample obeys a non-Gaussian distribution.
[0077] The method proceeds to block 620, with obtaining a first intermediate sample and a second intermediate sample at different time points along one trajectory transitioning between the first sample and the second sample.
[0078] In an embodiment, the trajectory transitioning between the first sample and the second sample may be defined by Eq (7) . Additionally, the first intermediate sample and the second intermediate sample at different time points may be illustrated as xt and xrin Fig. 5.
[0079] In an embodiment, the first generative model is trained based on a second generative model.
[0080] In a further example, the second generative model is pre-trained.
[0081] In a further embodiment, the first intermediate sample may be obtained by starting from the first sample to a first intermediate time point of one trajectory transitioning from the first sample to the second sampe via a forward diffusion process of the second generative model. For example, the first intermediate sample may be obtained by evaluation of Eq (5) .
[0082] In a further embodiment, the second intermediate sample may be obtained by starting from the first intermediate sample back to a second intermediate time point before the first intermediate time point along the same trajectory via a reverse diffusion process of the second generative model. For example, the second intermediate sample may be obtained by evaluation of Eq (7) . For example, the evaluation of Eq (7) may be carried out based on a pre-trained score predictor or by an ODE solver as in Eq (11) .
[0083] In a further embodiment, the first generative model is a consistency model.
[0084] In a further embodiment, the second generative model is a diffusion bridge model.
[0085] In a further embodiment, the diffusion bridge model may be one of: Brownian bridge, Diffusion bridge.
[0086] The method proceeds to block 630, with predicting, conditioned partially on the second sample, the first and the second intermediate samples via the first generative model directly at a starting time point of the trajectory respectively to obtain a first predicted sample and a second predicted sample.
[0087] In an embodiment, the first intermediate sample may be prediceted conditioned partially on the second sample via the first generative model, and the second intermediate sample may be predicted conditioned partially on the second sample via an exponential moving average of the first generative model.
[0088] The method proceeds to block 640, with optimizing the first generative model based at least on minimizing a distance between the first predicted sample and the second predicted sample.
[0089] In an embodiment, the first generative model may be optimized based on a training objective as in one of Eq (9) , (10) , (16) - (18) .
[0090] Fig. 7 illustrates an example method 700 for generating a sample from another deterministic sample by a generative model trained with any method disclosed herein, in accordance with various aspects of the present disclosure. As described below, some or all illustrated features may be omitted in an implementation within the scope of the present disclosure, and some illustrated features may not be required for implementation of all embodiments. Further, some of the blocks may be performed parallel or in a different order.
[0091] The method begins at block 710, with sampling a sample from a non-Gaussian distribution.
[0092] The method proceeds to block 720, with obtaining a sample estimation via an initial evaluation of the trained generative model. For example, the sample estimation may be obtained via hθ (xT, T, y) based on the trained hθ.
[0093] The method proceeds to block 730, with sampling a valid starting point for generating the third sample from a distribution conditioned on the fourth sample and the sample estimation. For example, the valid starting point may be sampled from qT-γ|0T (xT-γ|x0=hθ (xT, T, y) , xT=y) for some γ>0.
[0094] The method proceeds to block 740, with generating a new sample by the trained generative model from the valid starting point. For example, the new sample may be generated from xT-γ via x0=hθ(xT-γ, T-γ, y) based on the trained hθ.
[0095] In an embodiment, the new sample may be generated by obtaining a sample via an evaluation of the trained generative model, and adjusting the obtained sample by alternating a forward diffusion step and an evaluation step of the trained generative model at one or more time points. For example, after a sample x0=hθ(xT-γ, T-γ, y) is generated, one or more intermediate time points t1…tN may be obtained between 0 and T, a forward diffusion step may be performed to obtain x1 from x0, for example according to Eq (5) , and a consistency model evaluation step may be performed to obtain x′0 from x1, for example by x′0=hθ (x1, t1, y) and the two steps may be iterated for each intermediate time points t1…tN.
[0096] Fig. 8 illustrates an exemplary computer system 800, in accordance with various aspects of the present disclosure.
[0097] The computer system may comprise at least one processor 810. The computer system may further comprise at least one storage device 820. It should be appreciated that the storage device 820 may store computer-executable instructions that, when executed, cause the processor 810 to perform a method for training a first generative model according to the embodiments of the present disclosure as described in connection with Figs. 1-7.
[0098] The method for training a first generative model comprises obtaining a data pair from a training set, wherein the data pair comprises a first sample and a second sample, wherein the first sample and the second sample are deterministic; obtaining a first intermediate sample and a second intermediate sample at different time points along one trajectory transitioning between the first sample and the second sample; predicting, conditioned partially on the second sample, the first and the second intermediate samples directly at a starting time point of the trajectory respectively to obtain a first predicted sample and a second predicted sample; and optimizing the first generative model based at least on minimizing a distance between the first predicted sample and the second predicted sample.
[0099] Further, it should be appreciated that the storage device 820 may store computer-executable instructions that, when executed, cause the processor 810 to perform a method for generating a third sample from a fourth sample which is deterministic by the first generative model trained according to the embodiments of the present disclosure as described in connection with Figs. 1-7.
[0100] The method for generating a third sample from a fourth sample which is deterministic by the first generative model trained with any method disclosed herein comprises sampling the fourth sample from a non-Gaussian distribution; obtaining a sample estimation via an initial evaluation of the trained first generative model; sampling a valid starting point for generating the third sample from a distribution conditioned on the fourth sample and the sample estimation; and generating the third sample by the trained first generative model from the valid starting point.
[0101] It should be appreciated that the storage device 820 may store computer-executable instructions that, when executed, cause the processor 810 to perform any operations according to the embodiments of the present disclosure as described in connection with Figs. 1-7.
[0102] The embodiments of the present disclosure may be embodied in one or more computer-readable medium such as non-transitory computer-readable medium. The non-transitory computer-readable medium may store instructions that, when executed, cause one or more processors to perform any operations according to the embodiments of the present disclosure as described in connection with Figs. 1-7.
[0103] The embodiments of the present disclosure may be embodied in a computer program product comprising computer-executable instructions that, when executed, cause one or more processors to perform any operations according to the embodiments of the present disclosure as described in connection with Figs. 1-7.
[0104] It should be appreciated that all the operations in the methods described above are merely exemplary, and the present disclosure is not limited to any operations in the methods or sequence orders of these operations, and should cover all other equivalents under the same or similar concepts.
[0105] It should also be appreciated that all the modules in the apparatuses described above may be implemented in various approaches. These modules may be implemented as hardware, software, or a combination thereof. Moreover, any of these modules may be further functionally divided into sub-modules or combined together.
[0106] The previous description is provided to enable any person skilled in the art to practice the various aspects described herein. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects. Thus, the claims are not intended to be limited to the aspects shown herein. All structural and functional equivalents to the elements of the various aspects described throughout the present disclosure that are known or later come to be known to those of ordinary skill in the art are expressly incorporated herein by reference and are intended to be encompassed by the claims.
Claims
1.A computer implemented method for training a first generative model, comprising:obtaining a data pair from a training set, wherein the data pair comprises a first sample and a second sample, wherein the first sample and the second sample are deterministic;obtaining a first intermediate sample and a second intermediate sample at different time points along one trajectory transitioning between the first sample and the second sample;predicting, conditioned partially on the second sample, the first and the second intermediate samples via the first generative model directly at a starting time point of the trajectory respectively to obtain a first predicted sample and a second predicted sample; andoptimizing the first generative model based at least on minimizing a distance between the first predicted sample and the second predicted sample.2.The computer implemented method of claim 1, wherein the data pair from the training set is one type of image, audio or text.3.The computer implemented method of claim 1, wherein each of the first sample and the second sample obeys a non-Gaussian distribution.4.The computer implemented method of claim 1, wherein the first generative model is trained based on a second generative model.5.The computer implemented method of claim 4, wherein obtaining a first intermediate sample and a second intermediate sample at different time points along one trajectory transitioning between the first sample and the second sample further comprising:transitioning, starting from the first sample, to a first intermediate time point of one trajectory transitioning from the first sample to the second sample to obtain the first intermediate sample via a forward diffusion process of the second generative model; andtransitioning, starting from the first intermediate sample, back to a second intermediate time point before the first intermediate time point along the same trajectory via a reverse diffusion process of the second generative model to obtain the second intermediate sample.6.The computer implemented method of claim 4, wherein the second generative model is pre-trained.7.The computer implemented method of claim 4, wherein the first generative model is a consistency model, and / or the second generative model is a diffusion bridge model.8.The computer implemented method of claim 7, wherein the diffusion bridge model is one of: Brownian bridge, Diffusion bridge.9.The computer implemented method of claim 1, wherein mapping the first and the second intermediate samples directly to a starting time point of the trajectory respectively conditioned partially on the second sample to obtain a first predicted sample and a second predicted sample further comprising:predicting, conditioned partially on the second sample, the first intermediate sample at the starting time point of the trajectory via the first generative model; andpredicting, conditioned partially on the second sample, the second intermediate sample at the starting time point of the trajectory via an exponential moving average of the first generative model during training.10.A computer implemented method for generating a third sample from a fourth sample which is deterministic by the first generative model trained with one of claims 1-9, comprising:sampling the fourth sample from a non-Gaussian distribution;obtaining a sample estimation via an initial evaluation of the trained first generative model;sampling a valid starting point for generating the third sample from a distribution conditioned on the fourth sample and the sample estimation; andgenerating the third sample by the trained first generative model from the valid starting point.11.The computer implemented method of claim 10, wherein generating the third sample by the trained first generative model from the valid starting point further comprising:obtaining a sample via an evaluation of the trained first generative model;adjusting the obtained sample by alternating a forward diffusion step and an evaluation step of the trained first generative model at one or more time points to obtain the third sample.12.A computer system, comprising:one or more processors; andone or more storage devices coupled to the one or more processors having computer-executable instructions therein that, when executed, cause the one or more processors to perform the operations of the method of one of claims 1-11.13.One or more computer readable storage medium having computer-executable instructions thereon that, when executed, cause one or more processors to perform the operations of the method of one of claims 1-11.14.A computer program product comprising computer-executable instructions that, when executed, cause one or more processors to perform the operations of the method of one of claims 1-11.15.An apparatus, comprising one or more means for performing the operations of the method of one of claims 1-11.