Diffusers documentation
FlowMatchHeunDiscreteScheduler
FlowMatchHeunDiscreteScheduler
FlowMatchHeunDiscreteScheduler는 EDM에서 소개된 flow-matching 샘플링을 기반으로 합니다.
FlowMatchHeunDiscreteScheduler
클래스 diffusers.FlowMatchHeunDiscreteScheduler
< source >( num_train_timesteps: int = 1000shift: float = 1.0 )
Heun 스케줄러.
이 모델은 SchedulerMixin과 ConfigMixin을 상속합니다. 로딩 및 저장과 같은 모든 스케줄러에 대해 라이브러리가 구현하는 일반적 메서드에 대해서는 상위 클래스 문서를 확인하세요.
index_for_timestep
< source >( timestep: typing.Union[float, torch.FloatTensor]schedule_timesteps: typing.Optional[torch.FloatTensor] = None ) → int
…
scale_noise
< source >( sample: FloatTensortimestep: typing.Union[float, torch.FloatTensor]noise: FloatTensor ) → torch.FloatTensor
Flow-matching의 forward process
set_begin_index
< source >( begin_index: int = 0 )
… 스케줄러의 시작 인덱스를 설정합니다. 이 함수는 추론 전에 파이프라인에서 실행해야 합니다.
set_timesteps
< source >( num_inference_steps: intdevice: typing.Union[str, torch.device] = None )
추론 실행 전에 실행할 diffusion chain에 사용할 이산 timesteps를 설정합니다.
단계
< source >( model_output: FloatTensortimestep: typing.Union[float, torch.FloatTensor]sample: FloatTensors_churn: float = 0.0s_tmin: float = 0.0s_tmax: float = infs_noise: float = 1.0generator: typing.Optional[torch.Generator] = Nonereturn_dict: bool = True ) → FlowMatchHeunDiscreteSchedulerOutput or tuple
매개변수
- model_output (
torch.FloatTensor) — 학습된 diffusion 모델의 직접적인 출력입니다. - timestep (
float또는torch.FloatTensor) — 확산 체인(diffusion chain)의 현재 이산 시간 단계(discrete timestep)입니다. - sample (
torch.FloatTensor) — 확산 과정에 의해 생성된 샘플의 현재 인스턴스입니다. - s_churn (
float) — 샘플링 중에 추가되는 노이즈의 양을 제어하는 확률성 파라미터입니다. 값이 높을수록 무작위성이 증가합니다. - s_tmin (
float) — 확률성을 적용하기 위한 최소 타임스텝 임계값입니다. 이 값보다 큰 타임스텝에만 노이즈가 추가됩니다. - s_tmax (
float) — 확률성을 적용하기 위한 최대 타임스텝 임계값입니다. 이 값보다 작은 타임스텝에만 노이즈가 추가됩니다. - s_noise (
float, 기본값 1.0) — 샘플에 추가되는 노이즈의 스케일링 계수. - generator (
torch.Generator, 선택 사항) — 난수 생성기입니다. - return_dict (
bool) —FlowMatchHeunDiscreteSchedulerOutput튜플을 반환할지 여부.
반환값
FlowMatchHeunDiscreteSchedulerOutput 또는 tuple
return_dict가 True인 경우
FlowMatchHeunDiscreteSchedulerOutput이 반환되고,
그렇지 않으면 첫 번째 요소가 샘플 텐서인 튜플이 반환됩니다.
이전 시간 단계의 샘플을 SDE를 역방향으로 적용하여 예측합니다. 이 함수는 학습된 모델의 출력(대부분 예측된 노이즈)으로부터 확산 과정을 전파합니다.