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

Method q_mean_variance

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

Source from the content-addressed store, hash-verified

227 self.register_buffer('spec_max', torch.FloatTensor(spec_max)[None, None, :hparams['keep_bins']])
228
229 def q_mean_variance(self, x_start, t):
230 mean = extract(self.sqrt_alphas_cumprod, t, x_start.shape) * x_start
231 variance = extract(1. - self.alphas_cumprod, t, x_start.shape)
232 log_variance = extract(self.log_one_minus_alphas_cumprod, t, x_start.shape)
233 return mean, variance, log_variance
234
235 def predict_start_from_noise(self, x_t, t, noise):
236 return (

Callers

nothing calls this directly

Calls 1

extractFunction · 0.70

Tested by

no test coverage detected