ArthurZ HF staff commited on
Commit
0b0b185
1 Parent(s): 0aed3e9

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +39 -34
README.md CHANGED
@@ -1,54 +1,59 @@
1
  ---
2
- language: en
3
  license: apache-2.0
4
- library_name: diffusers
5
- tags: []
6
- datasets: huggan/flowers-102-categories
7
- metrics: []
8
  ---
9
 
10
- <!-- This model card has been generated automatically according to the information the training script had access to. You
11
- should probably proofread and complete it, then remove this comment. -->
12
 
13
- # ddpm-ema-flowers-64
14
 
15
- ## Model description
16
 
17
- This diffusion model is trained with the [🤗 Diffusers](https://github.com/huggingface/diffusers) library
18
- on the `huggan/flowers-102-categories` dataset.
19
 
20
- ## Intended uses & limitations
21
 
22
- #### How to use
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  ```python
25
- # TODO: add an example code snippet for running this diffusion pipeline
26
- ```
27
 
28
- #### Limitations and bias
29
 
30
- [TODO: provide examples of latent issues and potential remediations]
 
31
 
32
- ## Training data
 
33
 
34
- [TODO: describe the data used to train the model]
35
 
36
- ### Training hyperparameters
 
 
37
 
38
- The following hyperparameters were used during training:
39
- - learning_rate: 0.0001
40
- - train_batch_size: 16
41
- - eval_batch_size: 16
42
- - gradient_accumulation_steps: 1
43
- - optimizer: AdamW with betas=(0.95, 0.999), weight_decay=1e-06 and epsilon=1e-08
44
- - lr_scheduler: cosine
45
- - lr_warmup_steps: 500
46
- - ema_inv_gamma: 1.0
47
- - ema_inv_gamma: 0.75
48
- - ema_inv_gamma: 0.9999
49
- - mixed_precision: no
50
 
51
- ### Training results
52
 
53
- 📈 [TensorBoard logs](https://huggingface.co/anton-l/ddpm-ema-flowers-64/tensorboard?#scalars)
54
 
 
 
 
 
 
 
1
  ---
 
2
  license: apache-2.0
3
+ tags:
4
+ - pytorch
5
+ - diffusers
6
+ - unconditional-image-generation
7
  ---
8
 
9
+ # Denoising Diffusion Probabilistic Models (DDPM)
 
10
 
11
+ **Paper**: [Denoising Diffusion Probabilistic Models](https://arxiv.org/abs/2006.11239)
12
 
13
+ **Authors**: Jonathan Ho, Ajay Jain, Pieter Abbeel
14
 
15
+ **Abstract**:
 
16
 
17
+ *We present high quality image synthesis results using diffusion probabilistic models, a class of latent variable models inspired by considerations from nonequilibrium thermodynamics. Our best results are obtained by training on a weighted variational bound designed according to a novel connection between diffusion probabilistic models and denoising score matching with Langevin dynamics, and our models naturally admit a progressive lossy decompression scheme that can be interpreted as a generalization of autoregressive decoding. On the unconditional CIFAR10 dataset, we obtain an Inception score of 9.46 and a state-of-the-art FID score of 3.17. On 256x256 LSUN, we obtain sample quality similar to ProgressiveGAN.*
18
 
19
+ ## Inference
20
+
21
+ **DDPM** models can use *discrete noise schedulers* such as:
22
+
23
+ - [scheduling_ddpm](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ddpm.py)
24
+ - [scheduling_ddim](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ddim.py)
25
+ - [scheduling_pndm](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_pndm.py)
26
+
27
+ for inference. Note that while the *ddpm* scheduler yields the highest quality, it also takes the longest.
28
+ For a good trade-off between quality and inference speed you might want to consider the *ddim* or *pndm* schedulers instead.
29
+
30
+ See the following code:
31
 
32
  ```python
33
+ # !pip install diffusers
34
+ from diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline
35
 
36
+ model_id = "google/ddpm-cifar10-32"
37
 
38
+ # load model and scheduler
39
+ ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
40
 
41
+ # run pipeline in inference (sample random noise and denoise)
42
+ image = ddpm()["sample"]
43
 
 
44
 
45
+ # save image
46
+ image[0].save("ddpm_generated_image.png")
47
+ ```
48
 
49
+ For more in-detail information, please have a look at the [official inference example](_) # <- TODO(PVP) add link
 
 
 
 
 
 
 
 
 
 
 
50
 
51
+ ## Training
52
 
53
+ If you want to train your own model, please have a look at the [official training example]( ) # <- TODO(PVP) add link
54
 
55
+ ## Samples
56
+ 1. ![sample_1](https://huggingface.co/anton-l/ddpm-ema-flowers-64/resolve/main/generated_image_0.png)
57
+ 2. ![sample_2](https://huggingface.co/anton-l/ddpm-ema-flowers-64/resolve/main/generated_image_1.png)
58
+ 3. ![sample_3](https://huggingface.co/anton-l/ddpm-ema-flowers-64/resolve/main/generated_image_2.png)
59
+ 4. ![sample_4](https://huggingface.co/anton-l/ddpm-ema-flowers-64/resolve/main/generated_image_3.png)