Compare commits

...
2 Commits
Author SHA1 Message Date
Phil Wang ddc31bc489 trust paper 2022-11-27 10:05:55 -08:00
Phil Wang e872ec3618 tweak readme 2022-11-21 10:08:56 -08:00
3 changed files with 17 additions and 4 deletions
+12 -2
View File
@@ -42,7 +42,7 @@ diffusion = GaussianDiffusion(
loss_type = 'l1' # L1 or L2
)
training_images = torch.randn(8, 3, 128, 128) # images are normalized from 0 to 1
training_images = torch.rand(8, 3, 128, 128) # images are normalized from 0 to 1
loss = diffusion(training_images)
loss.backward()
# after a lot of training
@@ -124,7 +124,7 @@ diffusion = GaussianDiffusion1D(
objective = 'pred_v'
)
training_seq = torch.randn(8, 32, 128) # features are normalized from 0 to 1
training_seq = torch.rand(8, 32, 128) # features are normalized from 0 to 1
loss = diffusion(training_seq)
loss.backward()
@@ -248,3 +248,13 @@ sampled_seq.shape # (4, 32, 128)
volume = {abs/2207.12598}
}
```
```bibtex
@article{Sunkara2022NoMS,
title = {No More Strided Convolutions or Pooling: A New CNN Building Block for Low-Resolution Images and Small Objects},
author = {Raja Sunkara and Tie Luo},
journal = {ArXiv},
year = {2022},
volume = {abs/2208.03641}
}
```
@@ -86,7 +86,10 @@ def Upsample(dim, dim_out = None):
)
def Downsample(dim, dim_out = None):
return nn.Conv2d(dim, default(dim_out, dim), 4, 2, 1)
return nn.Sequential(
Rearrange('b c (h p1) (w p2) -> b (c p1 p2) h w', p1 = 2, p2 = 2),
nn.Conv2d(dim * 4, default(dim_out, dim), 1)
)
class WeightStandardizedConv2d(nn.Conv2d):
"""
+1 -1
View File
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name = 'denoising-diffusion-pytorch',
packages = find_packages(),
version = '0.31.1',
version = '0.32.0',
license='MIT',
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
author = 'Phil Wang',