Shortcuts

mmedit.models.editors.ddim

Package Contents

Classes

DDIMScheduler

`DDIMScheduler` support the diffusion and reverse process formulated

class mmedit.models.editors.ddim.DDIMScheduler(num_train_timesteps=1000, beta_start=0.0001, beta_end=0.02, beta_schedule='linear', variance_type='learned_range', timestep_values=None, clip_sample=True, set_alpha_to_one=True)[源代码]

`DDIMScheduler` support the diffusion and reverse process formulated in https://arxiv.org/abs/2010.02502.

The code is heavily influenced by https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_ddim.py. # noqa The difference is that we ensemble gradient-guided sampling in step function.

参数
  • num_train_timesteps (int, optional) – _description_. Defaults to 1000.

  • beta_start (float, optional) – _description_. Defaults to 0.0001.

  • beta_end (float, optional) – _description_. Defaults to 0.02.

  • beta_schedule (str, optional) – _description_. Defaults to “linear”.

  • variance_type (str, optional) – _description_. Defaults to ‘learned_range’.

  • timestep_values (_type_, optional) – _description_. Defaults to None.

  • clip_sample (bool, optional) – _description_. Defaults to True.

  • set_alpha_to_one (bool, optional) – _description_. Defaults to True.

set_timesteps(num_inference_steps, offset=0)

set time steps.

_get_variance(timestep, prev_timestep)

get variance.

step(model_output: Union[torch.FloatTensor, numpy.ndarray], timestep: int, sample: Union[torch.FloatTensor, numpy.ndarray], cond_fn=None, cond_kwargs={}, eta: float = 0.0, use_clipped_model_output: bool = False, generator=None)

step forward.

add_noise(original_samples, noise, timesteps)

add noise.

__len__()
Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.