(self, model, x, t)
| 363 | @register_sampler(name='ddpm') |
| 364 | class DDPM(SpacedDiffusion): |
| 365 | def p_sample(self, model, x, t): |
| 366 | out = self.p_mean_variance(model, x, t) |
| 367 | sample = out['mean'] |
| 368 | |
| 369 | noise = torch.randn_like(x) |
| 370 | if t != 0: # no noise when t == 0 |
| 371 | sample += torch.exp(0.5 * out['log_variance']) * noise |
| 372 | |
| 373 | return {'sample': sample, 'pred_xstart': out['pred_xstart']} |
| 374 | |
| 375 | |
| 376 | @register_sampler(name='ddim') |
nothing calls this directly
no test coverage detected