(self, x_start, x_t, t)
| 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) |
no test coverage detected