MCPcopy
hub / github.com/ali-vilab/AnyDoor / q_posterior

Method q_posterior

ldm/models/diffusion/ddpm.py:304–311  ·  view source on GitHub ↗
(self, x_start, x_t, t)

Source from the content-addressed store, hash-verified

302 )
303
304 def q_posterior(self, x_start, x_t, t):
305 posterior_mean = (
306 extract_into_tensor(self.posterior_mean_coef1, t, x_t.shape) * x_start +
307 extract_into_tensor(self.posterior_mean_coef2, t, x_t.shape) * x_t
308 )
309 posterior_variance = extract_into_tensor(self.posterior_variance, t, x_t.shape)
310 posterior_log_variance_clipped = extract_into_tensor(self.posterior_log_variance_clipped, t, x_t.shape)
311 return posterior_mean, posterior_variance, posterior_log_variance_clipped
312
313 def p_mean_variance(self, x, t, clip_denoised: bool):
314 model_out = self.model(x, t)

Callers 2

p_mean_varianceMethod · 0.95
p_mean_varianceMethod · 0.80

Calls 1

extract_into_tensorFunction · 0.90

Tested by

no test coverage detected