Diffusers 文件
IPNDMScheduler
並獲得增強的文件體驗
開始使用
IPNDMScheduler
IPNDMScheduler
是一個四階改進偽線性多步排程器。原始實現可在 crowsonkb/v-diffusion-pytorch 找到。
IPNDMScheduler
class diffusers.IPNDMScheduler
< 源 >( num_train_timesteps: int = 1000 trained_betas: typing.Union[numpy.ndarray, typing.List[float], NoneType] = None )
一個四階改進偽線性多步排程器。
此模型繼承自 SchedulerMixin 和 ConfigMixin。請檢視超類文件,瞭解庫為所有排程器(如載入和儲存)實現的通用方法。
scale_model_input
< 源 >( sample: Tensor *args **kwargs ) → torch.Tensor
確保與需要根據當前時間步縮放去噪模型輸入的排程器互換使用。
設定排程器的起始索引。此函式應在推理之前從管道中執行。
set_timesteps
< 源 >( num_inference_steps: int device: typing.Union[str, torch.device] = None )
設定用於擴散鏈的離散時間步(在推理之前執行)。
步驟
< 源 >( model_output: Tensor timestep: typing.Union[int, torch.Tensor] sample: Tensor return_dict: bool = True ) → SchedulerOutput 或 tuple
引數
- model_output (
torch.Tensor
) — 來自學習到的擴散模型的直接輸出。 - timestep (
int
) — 擴散鏈中當前的離散時間步。 - sample (
torch.Tensor
) — 擴散過程建立的樣本的當前例項。 - return_dict (
bool
) — 是否返回 SchedulerOutput 或元組。
返回
排程器輸出 或 tuple
如果 return_dict 為 True
,則返回 SchedulerOutput,否則返回一個元組,其中第一個元素是樣本張量。
透過反轉 SDE 來預測前一個時間步的樣本。此函式使用線性多步方法傳播樣本。它執行多次前向傳播以近似解。
SchedulerOutput
class diffusers.schedulers.scheduling_utils.SchedulerOutput
< 源 >( prev_sample: Tensor )
排程器 step
函式輸出的基類。