mirror of
https://github.com/lucidrains/DALLE2-pytorch.git
synced 2025-12-19 09:44:19 +01:00
one more residual, after seeing good results on unconditional generation locally
This commit is contained in:
@@ -1488,7 +1488,7 @@ class Unet(nn.Module):
|
|||||||
]))
|
]))
|
||||||
|
|
||||||
self.final_conv = nn.Sequential(
|
self.final_conv = nn.Sequential(
|
||||||
ResnetBlock(dim, dim, groups = resnet_groups[0]),
|
ResnetBlock(dim * 2, dim, groups = resnet_groups[0]),
|
||||||
nn.Conv2d(dim, self.channels_out, 1)
|
nn.Conv2d(dim, self.channels_out, 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1560,6 +1560,7 @@ class Unet(nn.Module):
|
|||||||
# initial convolution
|
# initial convolution
|
||||||
|
|
||||||
x = self.init_conv(x)
|
x = self.init_conv(x)
|
||||||
|
r = x.clone() # final residual
|
||||||
|
|
||||||
# time conditioning
|
# time conditioning
|
||||||
|
|
||||||
@@ -1689,6 +1690,7 @@ class Unet(nn.Module):
|
|||||||
|
|
||||||
x = upsample(x)
|
x = upsample(x)
|
||||||
|
|
||||||
|
x = torch.cat((x, r), dim = 1)
|
||||||
return self.final_conv(x)
|
return self.final_conv(x)
|
||||||
|
|
||||||
class LowresConditioner(nn.Module):
|
class LowresConditioner(nn.Module):
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = '0.9.1'
|
__version__ = '0.9.2'
|
||||||
|
|||||||
Reference in New Issue
Block a user