mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-09 11:21:11 +08:00
add one more residual
This commit is contained in:
@@ -302,12 +302,14 @@ class Unet(nn.Module):
|
||||
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 = []
|
||||
@@ -330,6 +332,7 @@ class Unet(nn.Module):
|
||||
x = attn(x)
|
||||
x = upsample(x)
|
||||
|
||||
x = torch.cat((x, r), dim = 1)
|
||||
return self.final_conv(x)
|
||||
|
||||
# gaussian diffusion trainer class
|
||||
|
||||
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user