FlowMatchHeunDiscreteScheduler
is based on the flow-matching sampling introduced in EDM.
( num_train_timesteps: int = 1000 shift: float = 1.0 )
Parameters
int
, defaults to 1000) —
The number of diffusion steps to train the model. str
, defaults to "linspace"
) —
The way the timesteps should be scaled. Refer to Table 2 of the Common Diffusion Noise Schedules and
Sample Steps are Flawed for more information. float
, defaults to 1.0) —
The shift value for the timestep schedule. Heun scheduler.
This model inherits from SchedulerMixin and ConfigMixin. Check the superclass documentation for the generic methods the library implements for all schedulers such as loading and saving.
( sample: FloatTensor timestep: Union noise: Optional = None ) → torch.FloatTensor
Forward process in flow-matching
( begin_index: int = 0 )
Sets the begin index for the scheduler. This function should be run from pipeline before the inference.
( num_inference_steps: int device: Union = None )
Sets the discrete timesteps used for the diffusion chain (to be run before inference).
( model_output: FloatTensor timestep: Union sample: FloatTensor s_churn: float = 0.0 s_tmin: float = 0.0 s_tmax: float = inf s_noise: float = 1.0 generator: Optional = None return_dict: bool = True ) → ~schedulers.scheduling_Heun_discrete.HeunDiscreteSchedulerOutput
or tuple
Parameters
torch.FloatTensor
) —
The direct output from learned diffusion model. float
) —
The current discrete timestep in the diffusion chain. torch.FloatTensor
) —
A current instance of a sample created by the diffusion process. float
) — float
) — float
) — float
, defaults to 1.0) —
Scaling factor for noise added to the sample. torch.Generator
, optional) —
A random number generator. bool
) —
Whether or not to return a ~schedulers.scheduling_Heun_discrete.HeunDiscreteSchedulerOutput
or
tuple. Returns
~schedulers.scheduling_Heun_discrete.HeunDiscreteSchedulerOutput
or tuple
If return_dict is True
, ~schedulers.scheduling_Heun_discrete.HeunDiscreteSchedulerOutput
is
returned, otherwise a tuple is returned where the first element is the sample tensor.
Predict the sample from the previous timestep by reversing the SDE. This function propagates the diffusion process from the learned model outputs (most often the predicted noise).