MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / q_posterior

Method q_posterior

usr/diff/diffusion.py:241–248  ·  view source on GitHub ↗
(self, x_start, x_t, t)

Source from the content-addressed store, hash-verified

239 )
240
241 def q_posterior(self, x_start, x_t, t):
242 posterior_mean = (
243 extract(self.posterior_mean_coef1, t, x_t.shape) * x_start +
244 extract(self.posterior_mean_coef2, t, x_t.shape) * x_t
245 )
246 posterior_variance = extract(self.posterior_variance, t, x_t.shape)
247 posterior_log_variance_clipped = extract(self.posterior_log_variance_clipped, t, x_t.shape)
248 return posterior_mean, posterior_variance, posterior_log_variance_clipped
249
250 def p_mean_variance(self, x, t, cond, clip_denoised: bool):
251 noise_pred = self.denoise_fn(x, t, cond=cond)

Callers 1

p_mean_varianceMethod · 0.95

Calls 1

extractFunction · 0.70

Tested by

no test coverage detected