MCPcopy Index your code
hub / github.com/CompVis/diff2flow / q_mean_variance

Method q_mean_variance

diff2flow/ddpm.py:190–197  ·  view source on GitHub ↗

Get the distribution q(x_t | x_0).

(self, x_start, t)

Source from the content-addressed store, hash-verified

188 """ Training """
189
190 def q_mean_variance(self, x_start, t):
191 """
192 Get the distribution q(x_t | x_0).
193 """
194 mean = (extract_into_tensor(self.sqrt_alphas_cumprod, t, x_start.shape) * x_start)
195 variance = extract_into_tensor(1.0 - self.alphas_cumprod, t, x_start.shape)
196 log_variance = extract_into_tensor(self.log_one_minus_alphas_cumprod, t, x_start.shape)
197 return mean, variance, log_variance
198
199 def q_sample(self, x_start, t, noise=None):
200 """

Callers 1

prior_bpdMethod · 0.95

Calls 1

extract_into_tensorFunction · 0.70

Tested by

no test coverage detected