assume when sampling all batch samples are at the same time, and do not noise for the last time step

This commit is contained in:
Phil Wang
2022-06-07 16:12:44 -07:00
parent 3bbb6ebf16
commit 532178a6a3
2 changed files with 5 additions and 1 deletions
@@ -131,6 +131,10 @@ class ContinuousTimeGaussianDiffusion(nn.Module):
batch, *_, device = *x.shape, x.device
model_mean, model_variance = self.p_mean_variance(x = x, time = time, time_next = time_next)
if time_next == 0:
return model_mean
noise = torch.randn_like(x)
return model_mean + sqrt(model_variance) * noise
+1 -1
View File
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name = 'denoising-diffusion-pytorch',
packages = find_packages(),
version = '0.16.3',
version = '0.16.4',
license='MIT',
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
author = 'Phil Wang',