Diffusers documentation
IPNDMScheduler
IPNDMScheduler
IPNDMScheduler는 4차 Improved Pseudo Linear Multistep 스케줄러입니다. 원래 구현은 crowsonkb/v-diffusion-pytorch에서 확인할 수 있습니다.
IPNDMScheduler
클래스 diffusers.IPNDMScheduler
< source >( num_train_timesteps: int = 1000trained_betas: numpy.ndarray | list[float] | None = None )
4차 개선된 의사 선형 다단계 스케줄러
이 모델은 SchedulerMixin과 ConfigMixin을 상속합니다. 로딩 및 저장과 같은 모든 스케줄러에 대해 라이브러리가 구현하는 일반적 메서드에 대해서는 상위 클래스 문서를 확인하세요.
index_for_timestep
< source >( timestep: typing.Union[float, torch.Tensor]schedule_timesteps: typing.Optional[torch.Tensor] = None ) → int
매개변수
- timestep (
float또는torch.Tensor) — 스케줄에서 찾을 timestep 값입니다. - schedule_timesteps (
torch.Tensor, 선택 사항) — 검색할 timestep schedule입니다.None인 경우self.timesteps를 사용합니다.
반환값
int
The index of the timestep in the schedule. For the very first step, returns the second index if multiple matches exist to avoid skipping a sigma when starting mid-schedule (e.g., for image-to-image).
…
scale_model_input
< source >( sample: Tensor*args**kwargs ) → torch.Tensor
현재 timestep에 따라 denoising 모델 입력을 scale해야 하는 scheduler와의 호환성을 보장합니다.
set_begin_index
< source >( begin_index: int = 0 )
… 스케줄러의 시작 인덱스를 설정합니다. 이 함수는 추론 전에 파이프라인에서 실행해야 합니다.
set_timesteps
< source >( num_inference_steps: intdevice: typing.Union[str, torch.device, NoneType] = None )
추론 실행 전에 실행할 diffusion chain에 사용할 이산 timesteps를 설정합니다.
단계
< source >( model_output: Tensortimestep: typing.Union[int, torch.Tensor]sample: Tensorreturn_dict: bool = True ) → SchedulerOutput or tuple
매개변수
- model_output (
torch.Tensor) — 학습된 diffusion 모델의 직접적인 출력입니다. - timestep (
int또는torch.Tensor) — 확산 체인(diffusion chain)의 현재 이산 시간 단계(discrete timestep)입니다. - sample (
torch.Tensor) — 확산 과정에 의해 생성된 샘플의 현재 인스턴스입니다. - return_dict (
bool) —boolSchedulerOutput 또는 튜플을 반환할지 여부.
반환값
SchedulerOutput 또는 tuple
return_dict가 True인 경우 SchedulerOutput이 반환되고, 그렇지 않으면 첫 번째 요소가 샘플 텐서인 튜플이 반환됩니다.
이전 시간 단계의 샘플을 SDE를 역방향으로 적용하여 예측합니다. 이 함수는 선형 다단계 방법을 사용하여 샘플을 전파합니다. 해를 근사하기 위해 포워드 패스를 여러 번 수행합니다.
SchedulerOutput
class diffusers.schedulers.scheduling_utils.SchedulerOutput
< source >( prev_sample: Tensor )
스케줄러의 step 함수 출력을 위한 베이스 클래스.