Compare commits

..
1 Commits
Author SHA1 Message Date
Phil Wang cb4d57149e bring in ddim sampling 2022-07-09 15:22:53 -07:00
2 changed files with 2 additions and 5 deletions
@@ -533,7 +533,7 @@ class GaussianDiffusion(nn.Module):
return img
@torch.no_grad()
def ddim_sample(self, shape, clip_denoised = True):
def ddim_sample(self, shape, clip_denoised = False):
batch, device, total_timesteps, sampling_timesteps, eta, objective = shape[0], self.betas.device, self.num_timesteps, self.sampling_timesteps, self.ddim_sampling_eta, self.objective
times = torch.linspace(0., total_timesteps, steps = sampling_timesteps + 2)[:-1]
@@ -551,9 +551,6 @@ class GaussianDiffusion(nn.Module):
pred_noise, x_start, *_ = self.model_predictions(img, time_cond)
if clip_denoised:
x_start.clamp_(-1., 1.)
c1 = eta * ((1 - alpha / alpha_next) * (1 - alpha_next) / (1 - alpha)).sqrt()
c2 = ((1 - alpha_next) - torch.square(c1)).sqrt()
+1 -1
View File
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name = 'denoising-diffusion-pytorch',
packages = find_packages(),
version = '0.25.1',
version = '0.25.0',
license='MIT',
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
author = 'Phil Wang',