Skip to content

Commit

Permalink
just pluck the image size off the gaussian diffusion class
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jun 17, 2022
1 parent b4fb880 commit 1586d1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ def __init__(
folder,
*,
ema_decay = 0.995,
image_size = 128,
train_batch_size = 32,
train_lr = 1e-4,
train_num_steps = 100000,
Expand All @@ -610,6 +609,8 @@ def __init__(
augment_horizontal_flip = True
):
super().__init__()
self.image_size = diffusion_model.image_size

self.model = diffusion_model
self.ema = EMA(ema_decay)
self.ema_model = copy.deepcopy(self.model)
Expand All @@ -623,9 +624,9 @@ def __init__(
self.gradient_accumulate_every = gradient_accumulate_every
self.train_num_steps = train_num_steps

self.ds = Dataset(folder, image_size, augment_horizontal_flip = augment_horizontal_flip)
self.ds = Dataset(folder, self.image_size, augment_horizontal_flip = augment_horizontal_flip)
self.dl = cycle(data.DataLoader(self.ds, batch_size = train_batch_size, shuffle = True, pin_memory = True, num_workers = cpu_count()))
self.opt = Adam(diffusion_model.parameters(), lr=train_lr)
self.opt = Adam(diffusion_model.parameters(), lr = train_lr)

self.step = 0

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'denoising-diffusion-pytorch',
packages = find_packages(),
version = '0.20.1',
version = '0.20.2',
license='MIT',
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit 1586d1a

Please sign in to comment.