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

Method q_posterior

usr/diff/shallow_diffusion_tts.py:258–265  ·  view source on GitHub ↗
(self, x_start, x_t, t)

Source from the content-addressed store, hash-verified

256 )
257
258 def q_posterior(self, x_start, x_t, t):
259 posterior_mean = (
260 extract(self.posterior_mean_coef1, t, x_t.shape) * x_start +
261 extract(self.posterior_mean_coef2, t, x_t.shape) * x_t
262 )
263 posterior_variance = extract(self.posterior_variance, t, x_t.shape)
264 posterior_log_variance_clipped = extract(self.posterior_log_variance_clipped, t, x_t.shape)
265 return posterior_mean, posterior_variance, posterior_log_variance_clipped
266
267 def p_mean_variance(self, x, t, cond, clip_denoised: bool):
268 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