Compare commits

...
2 Commits
Author SHA1 Message Date
Phil Wang d59d8b05f6 fix a small bug 2020-09-06 01:50:59 -07:00
Phil Wang 365ce0c335 update readme 2020-09-06 01:44:05 -07:00
3 changed files with 15 additions and 4 deletions
+13 -2
View File
@@ -1,6 +1,6 @@
## Denoising Diffusion Probabilistic Model, in Pytorch (wip) ## Denoising Diffusion Probabilistic Model, in Pytorch (wip)
Implementation of <a href="https://arxiv.org/abs/2006.11239">Denoising Diffusion Probabilistic Model</a> in Pytorch Implementation of <a href="https://arxiv.org/abs/2006.11239">Denoising Diffusion Probabilistic Model</a> in Pytorch.
## Install ## Install
@@ -24,7 +24,7 @@ diffusion = GaussianDiffusion(
beta_start = 0.0001, beta_start = 0.0001,
beta_end = 0.02, beta_end = 0.02,
num_diffusion_timesteps = 1000, # number of steps num_diffusion_timesteps = 1000, # number of steps
loss_type = 'l1' # L1 or L2 loss_type = 'l1' # L1 or L2 (wavegrad paper claims l1 is better?)
) )
training_images = torch.randn(8, 3, 128, 128) training_images = torch.randn(8, 3, 128, 128)
@@ -48,3 +48,14 @@ sampled_images.shape # (1, 3, 128, 128)
primaryClass={cs.LG} primaryClass={cs.LG}
} }
``` ```
```bibtex
@misc{chen2020wavegrad,
title={WaveGrad: Estimating Gradients for Waveform Generation},
author={Nanxin Chen and Yu Zhang and Heiga Zen and Ron J. Weiss and Mohammad Norouzi and William Chan},
year={2020},
eprint={2009.00713},
archivePrefix={arXiv},
primaryClass={eess.AS}
}
```
@@ -322,5 +322,5 @@ class GaussianDiffusion(nn.Module):
def forward(self, x, *args, **kwargs): def forward(self, x, *args, **kwargs):
b, *_, device = *x.shape, x.device b, *_, device = *x.shape, x.device
t = torch.randint(0, 1000, (b,), device=device).long() t = torch.randint(0, self.num_timesteps, (b,), device=device).long()
return self.p_losses(x, t, *args, **kwargs) return self.p_losses(x, t, *args, **kwargs)
+1 -1
View File
@@ -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.0.1', version = '0.0.2',
license='MIT', license='MIT',
description = 'Denoising Diffusion Probabilistic Models - Pytorch', description = 'Denoising Diffusion Probabilistic Models - Pytorch',
author = 'Phil Wang', author = 'Phil Wang',