mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-11 12:11:43 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddc31bc489 | ||
|
|
e872ec3618 |
@@ -42,7 +42,7 @@ diffusion = GaussianDiffusion(
|
|||||||
loss_type = 'l1' # L1 or L2
|
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 = diffusion(training_images)
|
||||||
loss.backward()
|
loss.backward()
|
||||||
# after a lot of training
|
# after a lot of training
|
||||||
@@ -124,7 +124,7 @@ diffusion = GaussianDiffusion1D(
|
|||||||
objective = 'pred_v'
|
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 = diffusion(training_seq)
|
||||||
loss.backward()
|
loss.backward()
|
||||||
|
|
||||||
@@ -248,3 +248,13 @@ sampled_seq.shape # (4, 32, 128)
|
|||||||
volume = {abs/2207.12598}
|
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):
|
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):
|
class WeightStandardizedConv2d(nn.Conv2d):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name = 'denoising-diffusion-pytorch',
|
name = 'denoising-diffusion-pytorch',
|
||||||
packages = find_packages(),
|
packages = find_packages(),
|
||||||
version = '0.31.1',
|
version = '0.32.0',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
||||||
author = 'Phil Wang',
|
author = 'Phil Wang',
|
||||||
|
|||||||
Reference in New Issue
Block a user