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