mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-12 12:22:11 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0d59acdfd |
@@ -542,7 +542,7 @@ class GaussianDiffusion(nn.Module):
|
|||||||
|
|
||||||
x_start = None
|
x_start = None
|
||||||
|
|
||||||
for t in tqdm(reversed(range(0, self.num_timesteps)), desc = 'sampling loop time step'):
|
for t in tqdm(reversed(range(0, self.num_timesteps)), desc = 'sampling loop time step', total = self.num_timesteps):
|
||||||
self_cond = x_start if self.self_condition else None
|
self_cond = x_start if self.self_condition else None
|
||||||
img, x_start = self.p_sample(img, t, self_cond)
|
img, x_start = self.p_sample(img, t, self_cond)
|
||||||
|
|
||||||
@@ -599,11 +599,11 @@ class GaussianDiffusion(nn.Module):
|
|||||||
|
|
||||||
assert x1.shape == x2.shape
|
assert x1.shape == x2.shape
|
||||||
|
|
||||||
t_batched = torch.stack([torch.tensor(t, device=device)] * b)
|
t_batched = torch.stack([torch.tensor(t, device = device)] * b)
|
||||||
xt1, xt2 = map(lambda x: self.q_sample(x, t=t_batched), (x1, x2))
|
xt1, xt2 = map(lambda x: self.q_sample(x, t = t_batched), (x1, x2))
|
||||||
|
|
||||||
img = (1 - lam) * xt1 + lam * xt2
|
img = (1 - lam) * xt1 + lam * xt2
|
||||||
for i in tqdm(reversed(range(0, t)), desc='interpolation sample time step', total=t):
|
for i in tqdm(reversed(range(0, t)), desc = 'interpolation sample time step', total = t):
|
||||||
img = self.p_sample(img, torch.full((b,), i, device=device, dtype=torch.long))
|
img = self.p_sample(img, torch.full((b,), i, device=device, dtype=torch.long))
|
||||||
|
|
||||||
return img
|
return img
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name = 'denoising-diffusion-pytorch',
|
name = 'denoising-diffusion-pytorch',
|
||||||
packages = find_packages(),
|
packages = find_packages(),
|
||||||
version = '0.27.0',
|
version = '0.27.1',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
||||||
author = 'Phil Wang',
|
author = 'Phil Wang',
|
||||||
|
|||||||
Reference in New Issue
Block a user