mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-09 11:21:11 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user