mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-10 12:01:08 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c758662a3 | ||
|
|
1f1e42e9f9 | ||
|
|
e1800c1a8d |
@@ -1,6 +1,6 @@
|
||||
<img src="./denoising-diffusion.png" width="500px"></img>
|
||||
|
||||
## Denoising Diffusion Probabilistic Model, in Pytorch (wip)
|
||||
## Denoising Diffusion Probabilistic Model, in Pytorch
|
||||
|
||||
Implementation of <a href="https://arxiv.org/abs/2006.11239">Denoising Diffusion Probabilistic Model</a> in Pytorch. It is a new approach to generative modeling that may <a href="https://ajolicoeur.wordpress.com/the-new-contender-to-gans-score-matching-with-langevin-sampling/">have the potential</a> to rival GANs. It uses denoising score matching to estimate the gradient of the data distribution, followed by Langevin sampling to sample from the true distribution. This implementation was transcribed from the official Tensorflow version <a href="https://github.com/hojonathanho/diffusion">here</a>.
|
||||
|
||||
@@ -61,9 +61,9 @@ trainer = Trainer(
|
||||
'path/to/your/images',
|
||||
image_size = 128,
|
||||
train_batch_size = 32,
|
||||
train_lr = 3e-4,
|
||||
train_lr = 2e-5,
|
||||
train_num_steps = 100000,
|
||||
gradient_accumulate_every = 1
|
||||
gradient_accumulate_every = 2
|
||||
)
|
||||
|
||||
trainer.train()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB |
@@ -372,9 +372,9 @@ class Trainer(object):
|
||||
*,
|
||||
image_size = 128,
|
||||
train_batch_size = 32,
|
||||
train_lr = 3e-4,
|
||||
train_lr = 2e-5,
|
||||
train_num_steps = 100000,
|
||||
gradient_accumulate_every = 1
|
||||
gradient_accumulate_every = 2
|
||||
):
|
||||
super().__init__()
|
||||
self.model = diffusion_model
|
||||
@@ -403,7 +403,7 @@ class Trainer(object):
|
||||
milestone = ind // SAVE_AND_SAMPLE_EVERY
|
||||
all_images = self.model.p_sample_loop((64, 3, self.image_size, self.image_size))
|
||||
utils.save_image(all_images, f'./sample-{milestone}.png', nrow=8)
|
||||
torch.save(model.state_dict(), f'./model-{milestone}.pt')
|
||||
torch.save(self.model.state_dict(), f'./model-{milestone}.pt')
|
||||
|
||||
ind += 1
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
||||
setup(
|
||||
name = 'denoising-diffusion-pytorch',
|
||||
packages = find_packages(),
|
||||
version = '0.1.0',
|
||||
version = '0.1.2',
|
||||
license='MIT',
|
||||
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
||||
author = 'Phil Wang',
|
||||
|
||||
Reference in New Issue
Block a user