Skip to content

Commit 46013e8

Browse files
[Docs] Fix scheduler docs (#421)
* [Docs] Fix scheduler docs * up * Apply suggestions from code review
1 parent e7457b3 commit 46013e8

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

docs/source/api/schedulers.mdx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ specific language governing permissions and limitations under the License.
1414

1515
Diffusers contains multiple pre-built schedule functions for the diffusion process.
1616

17-
## What is a schduler?
17+
## What is a scheduler?
18+
1819
The schedule functions, denoted *Schedulers* in the library take in the output of a trained model, a sample which the diffusion process is iterating on, and a timestep to return a denoised sample.
1920

2021
- Schedulers define the methodology for iteratively adding noise to an image or for updating a sample based on model outputs.
@@ -23,73 +24,77 @@ The schedule functions, denoted *Schedulers* in the library take in the output o
2324
- Schedulers are often defined by a *noise schedule* and an *update rule* to solve the differential equation solution.
2425

2526
### Discrete versus continuous schedulers
27+
2628
All schedulers take in a timestep to predict the updated version of the sample being diffused.
2729
The timesteps dictate where in the diffusion process the step is, where data is generated by iterating forward in time and inference is executed by propagating backwards through timesteps.
28-
Different algorithms use timesteps that both discrete (accepting `int` inputs), such as the [`DDPMScheduler`] or [`PNDMScheduler`], and continuous (accepting 'float` inputs), such as the score-based schedulers [`ScoreSdeVeScheduler`] or [`ScoreSdeVpScheduler`].
30+
Different algorithms use timesteps that both discrete (accepting `int` inputs), such as the [`DDPMScheduler`] or [`PNDMScheduler`], and continuous (accepting `float` inputs), such as the score-based schedulers [`ScoreSdeVeScheduler`] or [`ScoreSdeVpScheduler`].
2931

3032
## Designing Re-usable schedulers
33+
3134
The core design principle between the schedule functions is to be model, system, and framework independent.
3235
This allows for rapid experimentation and cleaner abstractions in the code, where the model prediction is separated from the sample update.
3336
To this end, the design of schedulers is such that:
37+
3438
- Schedulers can be used interchangeably between diffusion models in inference to find the preferred trade-off between speed and generation quality.
3539
- Schedulers are currently by default in PyTorch, but are designed to be framework independent (partial Numpy support currently exists).
3640

3741

3842
## API
43+
3944
The core API for any new scheduler must follow a limited structure.
4045
- Schedulers should provide one or more `def step(...)` functions that should be called to update the generated sample iteratively.
4146
- Schedulers should provide a `set_timesteps(...)` method that configures the parameters of a schedule function for a specific inference task.
4247
- Schedulers should be framework-agonstic, but provide a simple functionality to convert the scheduler into a specific framework, such as PyTorch
4348
with a `set_format(...)` method.
4449

45-
### Core
4650
The base class [`SchedulerMixin`] implements low level utilities used by multiple schedulers.
4751

48-
#### SchedulerMixin
52+
### SchedulerMixin
4953
[[autodoc]] SchedulerMixin
5054

51-
#### SchedulerOutput
55+
### SchedulerOutput
5256
The class [`SchedulerOutput`] contains the ouputs from any schedulers `step(...)` call.
57+
5358
[[autodoc]] schedulers.scheduling_utils.SchedulerOutput
5459

55-
### Existing Schedulers
60+
### Implemented Schedulers
5661

5762
#### Denoising diffusion implicit models (DDIM)
5863

5964
Original paper can be found here.
6065

61-
[[autodoc]] schedulers.scheduling_ddim.DDIMScheduler
66+
[[autodoc]] DDIMScheduler
6267

6368
#### Denoising diffusion probabilistic models (DDPM)
6469

6570
Original paper can be found [here](https://arxiv.org/abs/2010.02502).
6671

67-
[[autodoc]] schedulers.scheduling_ddpm.DDPMScheduler
72+
[[autodoc]] DDPMScheduler
6873

6974
#### Varience exploding, stochastic sampling from Karras et. al
7075

7176
Original paper can be found [here](https://arxiv.org/abs/2006.11239).
7277

73-
[[autodoc]] schedulers.scheduling_karras_ve.KarrasVeScheduler
78+
[[autodoc]] KarrasVeScheduler
7479

7580
#### Linear multistep scheduler for discrete beta schedules
7681

7782
Original implementation can be found [here](https://arxiv.org/abs/2206.00364).
7883

7984

80-
[[autodoc]] schedulers.scheduling_lms_discrete.LMSDiscreteScheduler
85+
[[autodoc]] LMSDiscreteScheduler
8186

8287
#### Pseudo numerical methods for diffusion models (PNDM)
8388

8489
Original implementation can be found [here](https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L181).
8590

86-
[[autodoc]] schedulers.scheduling_pndm.PNDMScheduler
91+
[[autodoc]] PNDMScheduler
8792

8893
#### variance exploding stochastic differential equation (SDE) scheduler
8994

9095
Original paper can be found [here](https://arxiv.org/abs/2011.13456).
9196

92-
[[autodoc]] schedulers.scheduling_sde_ve.ScoreSdeVeScheduler
97+
[[autodoc]] ScoreSdeVeScheduler
9398

9499
#### variance preserving stochastic differential equation (SDE) scheduler
95100

0 commit comments

Comments
 (0)