mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-10 12:01:08 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8859864f63 | ||
|
|
32657f035f | ||
|
|
d97bc0278c | ||
|
|
8408775cfc |
@@ -15,12 +15,17 @@ from torch.optim import Adam
|
||||
from torchvision import transforms, utils
|
||||
from PIL import Image
|
||||
|
||||
from tqdm import tqdm
|
||||
from einops import rearrange, reduce
|
||||
from einops.layers.torch import Rearrange
|
||||
|
||||
from ema_pytorch import EMA
|
||||
|
||||
import sys
|
||||
if 'ipykernel' in sys.modules:
|
||||
from tqdm.notebook import tqdm
|
||||
else:
|
||||
from tqdm import tqdm
|
||||
|
||||
# helpers functions
|
||||
|
||||
def exists(x):
|
||||
|
||||
@@ -168,7 +168,7 @@ class ElucidatedDiffusion(nn.Module):
|
||||
for sigma, sigma_next, gamma in tqdm(sigmas_and_gammas, desc = 'sampling time step'):
|
||||
sigma, sigma_next, gamma = map(lambda t: t.item(), (sigma, sigma_next, gamma))
|
||||
|
||||
eps = gamma * torch.randn(shape, device = self.device)
|
||||
eps = self.S_noise * torch.randn(shape, device = self.device) # stochastic sampling
|
||||
|
||||
sigma_hat = sigma + gamma * sigma
|
||||
images_hat = images + sqrt(sigma_hat ** 2 - sigma ** 2) * eps
|
||||
|
||||
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
||||
setup(
|
||||
name = 'denoising-diffusion-pytorch',
|
||||
packages = find_packages(),
|
||||
version = '0.23.0',
|
||||
version = '0.23.2',
|
||||
license='MIT',
|
||||
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
||||
author = 'Phil Wang',
|
||||
|
||||
Reference in New Issue
Block a user