Skip to content

Commit

Permalink
add one more residual
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jun 16, 2022
1 parent 844e557 commit ec2397f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,14 @@ def __init__(
self.out_dim = default(out_dim, default_out_dim)

self.final_conv = nn.Sequential(
block_klass(dim, dim),
block_klass(dim * 2, dim),
nn.Conv2d(dim, self.out_dim, 1)
)

def forward(self, x, time):
x = self.init_conv(x)
r = x.clone()

t = self.time_mlp(time)

h = []
Expand All @@ -330,6 +332,7 @@ def forward(self, x, time):
x = attn(x)
x = upsample(x)

x = torch.cat((x, r), dim = 1)
return self.final_conv(x)

# gaussian diffusion trainer class
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.19.1',
version = '0.19.2',
license='MIT',
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit ec2397f

Please sign in to comment.