Skip to content

Commit 02b05ab

Browse files
committed
Tweak README
1 parent 0760512 commit 02b05ab

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

unit2/README.md

+10-16
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,40 @@ Here are the steps for this unit:
88

99
- Make sure you've [signed up for this course](https://huggingface.us17.list-manage.com/subscribe?u=7f57e683fa28b51bfc493d048&id=ef963b4162) so that you can be notified when new material is released
1010
- Read through the material below for an overview of the key ideas of this unit
11-
- Check out the _**FINE TUNING AND GUIDANCE NOTEBOOK TODO LINK**_ to fine-tune an existing diffusion model on a new dataset using the 🤗 Diffusers library
12-
- Read through the **CONDITIONING NOTEBOOK** to see how we can add additional control to the generation process.
11+
- Check out the _**Fine-Tuning and Guidance**_ notebook below to fine-tune an existing diffusion model on a new dataset using the 🤗 Diffusers library
1312
- Create your own custom pipeline and share it as a Gradio demo
1413

1514
:loudspeaker: Don't forget to join the [Discord](https://huggingface.co/join/discord), where you can discuss the material and share what you've made in the `#diffusion-models-class` channel.
1615

1716
## Fine-Tuning
1817

19-
As you may have seen in Unit 1, training diffusion models from scratch can be time-consuming! Especially as we push to higher resolutions, the time and data required to train a model from scratch can become impractical. Fortunately, there is a solution: begin with a model that has already been trained! This way we start from a model that has already learnt to denoise images of some kind, and the hope is that this provides a better starting point than beginning from a randomly initialized model.
18+
As you saw in Unit 1, training diffusion models from scratch can be time-consuming! Especially as we push to higher resolutions, the time and data required to train a model from scratch can become impractical. Fortunately, there is a solution: begin with a model that has already been trained! This way we start from a model that has already learnt to denoise images of some kind, and the hope is that this provides a better starting point than beginning from a randomly initialized model.
2019

2120
![Example images generated with a model trained on LSUN Bedrooms and fine-tuned for 500 steps on WikiArt](https://api.wandb.ai/files/johnowhitaker/dm_finetune/2upaa341/media/images/Sample%20generations_501_d980e7fe082aec0dfc49.png)
2221

23-
Fine-tuning typically works best if the new data somewhat resembles the base model's original training data (for example, beginning with a model trained on faces is probably a good idea if you're trying to generate cartoon faces) but suprisinggly the benefits persist even if the domain is changed quite drastically. The image above is generated from a [model trained on the LSUN Bedrooms dataset]([todo link](https://huggingface.co/google/ddpm-bedroom-256)) and fine-tuned for 500 steps on [the WikiArt dataset](https://huggingface.co/datasets/huggan/wikiart). The training script is included for reference alongside the notebooks for this unit.
22+
Fine-tuning typically works best if the new data somewhat resembles the base model's original training data (for example, beginning with a model trained on faces is probably a good idea if you're trying to generate cartoon faces) but suprisinggly the benefits persist even if the domain is changed quite drastically. The image above is generated from a [model](https://huggingface.co/johnowhitaker/sd-class-wikiart-from-bedrooms) trained on the LSUN Bedrooms dataset](https://huggingface.co/google/ddpm-bedroom-256) and fine-tuned for 500 steps on [the WikiArt dataset](https://huggingface.co/datasets/huggan/wikiart). The training script is included for reference alongside the notebooks for this unit.
2423

2524
## Guidance
2625

27-
Unconditional models don't give much control over what is generated. We can train a conditional model (more on that in the next section) that takes additional inputs to help steer the generation process, but what if we already have a trained unconditional model we'd like to use? Enter guidance, a process by which the model predictions at each step in the generation process are evaluated against some guidance function and modified such that the final generated image is more to our liking.
26+
Unconditional models don't give much control over what is generated. We can train a conditional model (more on that in the next section) that takes additional inputs to help steer the generation process, but what if we already have a trained unconditional model we'd like to use? Enter **_guidance_**, a process by which the model predictions at each step in the generation process are evaluated against some guidance function and modified such that the final generated image is more to our liking.
2827

2928
This guidance function can be almost anything, making this a powerful technique! In the notebook we build up from a simple example to one utilizing a powerful pre-trained model called CLIP which lets us guide generation based on a text description.
3029

31-
## Conditioning
32-
33-
Guidance is a great way to get some additional mileage from an unconditional diffusion model, but if we have additional information (such as a class label or an image caption) available during training then we can also feed this to the model for it to use as it makes its predictions. In doing so, we create a **conditional** model, which we can control at inference time by controlling what is fed in as conditioning. The notebook shows an example of a class-conditioned model which learns to generate images according to a class label. TODO note about timestep conditioning?
34-
3530
## Hands-On Notebook
3631

3732
At this point, you know enough to get started with the accompanying notebooks!
3833

39-
TODO link table and descriptions
34+
| Chapter | Colab | Kaggle | Gradient | Studio Lab |
35+
|:--------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
36+
| Fine-Tuning and Guidance | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/diffusion-models-class/blob/main/unit1/01_finetuning_and_guidance.ipynb) | [![Kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://github.com/huggingface/diffusion-models-class/blob/main/unit1/01_finetuning_and_guidance.ipynb) | [![Gradient](https://assets.paperspace.io/img/gradient-badge.svg)](https://console.paperspace.com/github/huggingface/diffusion-models-class/blob/main/unit1/01_finetuning_and_guidance.ipynb) | [![Open In SageMaker Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/diffusion-models-class/blob/main/unit1/01_finetuning_and_guidance.ipynb) |
37+
4038

4139
## Project Time
4240

43-
Create a custom pipeline using some or all of the ideas covered in this unit and share it with the community
41+
The best way to learn is by doing! Fine-tune your own diffusion model on a new image dataset and create a Gradio demo that can generate images from it. Don't forget to share your work with us on Discord, Twitter or elsewhere!
4442

4543
## Some Additional Resources
4644

47-
GLIDE (text conditioned diffusion model) TODO link
48-
49-
Thomas' example TODO link
50-
51-
45+
* [GLIDE](https://www.youtube.com/watch?v=lvv4N2nf-HU) (text conditioned diffusion model)
5246

5347
Found more great resources? Let us know and we'll add them to this list.

0 commit comments

Comments
 (0)