(self, x, t, clip_denoised: bool)
| 318 | return posterior_mean, posterior_variance, posterior_log_variance_clipped |
| 319 | |
| 320 | def p_mean_variance(self, x, t, clip_denoised: bool): |
| 321 | model_out = self.model(x, t) |
| 322 | if self.parameterization == "eps": |
| 323 | x_recon = self.predict_start_from_noise(x, t=t, noise=model_out) |
| 324 | elif self.parameterization == "x0": |
| 325 | x_recon = model_out |
| 326 | if clip_denoised: |
| 327 | x_recon.clamp_(-1., 1.) |
| 328 | |
| 329 | model_mean, posterior_variance, posterior_log_variance = self.q_posterior(x_start=x_recon, x_t=x, t=t) |
| 330 | return model_mean, posterior_variance, posterior_log_variance |
| 331 | |
| 332 | @torch.no_grad() |
| 333 | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): |
no test coverage detected