Buckets:

mishig's picture
|
download
raw
6.19 kB
# HeliosScheduler
`HeliosScheduler`은 [Helios](https://huggingface.co/papers)에서 소개된 피라미드형 flow-matching 샘플링을 기반으로 합니다.
## HeliosScheduler[[diffusers.HeliosScheduler]]
#### diffusers.HeliosScheduler[[diffusers.HeliosScheduler]]
```python
diffusers.HeliosScheduler(num_train_timesteps: int = 1000, shift: float = 1.0, stages: int = 3, stage_range: list = [0, 0.3333333333333333, 0.6666666666666666, 1], gamma: float = 0.3333333333333333, thresholding: bool = False, prediction_type: str = 'flow_prediction', solver_order: int = 2, predict_x0: bool = True, solver_type: str = 'bh2', lower_order_final: bool = True, disable_corrector: list[int] = [], solver_p: SchedulerMixin = None, use_flow_sigmas: bool = True, scheduler_type: str = 'unipc', use_dynamic_shifting: bool = False, time_shift_type: typing.Literal['exponential', 'linear'] = 'exponential')
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L35)
#### convert_model_output[[diffusers.HeliosScheduler.convert_model_output]]
```python
convert_model_output(model_output: Tensor, *args, sample: Tensor = None, sigma: Tensor = None, **kwargs)
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L371)
**매개변수:**
model_output (`torch.Tensor`) : 학습된 diffusion 모델의 직접적인 출력입니다.
timestep (`int`) : 확산 체인(diffusion chain)의 현재 이산 시간 단계(discrete timestep).
sample (`torch.Tensor`) : 확산 과정에서 생성된 샘플의 현재 인스턴스.
sigma (`torch.Tensor`, *선택 사항*) : 노이즈 스케줄에서 현재 단계의 시그마입니다.
**반환값:** `torch.Tensor`
변환된 모델 출력
UniPC 알고리즘이 필요로 하는 해당 유형으로 모델 출력을 변환합니다.
#### init_sigmas[[diffusers.HeliosScheduler.init_sigmas]]
```python
init_sigmas()
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L90)
전역 timesteps와 sigmas를 초기화합니다
#### init_sigmas_for_each_stage[[diffusers.HeliosScheduler.init_sigmas_for_each_stage]]
```python
init_sigmas_for_each_stage()
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L108)
각 단계의 timesteps를 초기화합니다
#### multistep_uni_c_bh_update[[diffusers.HeliosScheduler.multistep_uni_c_bh_update]]
```python
multistep_uni_c_bh_update(this_model_output: Tensor, *args, last_sample: Tensor = None, this_sample: Tensor = None, order: int = None, sigma_before: Tensor = None, sigma: Tensor = None, **kwargs)
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L591)
**매개변수:**
this_model_output (`torch.Tensor`) : `x_t`에서의 모델 출력입니다.
this_timestep (`int`) : 현재 타임스텝 `t`.
last_sample (`torch.Tensor`) : 마지막 예측기 `x_{t-1}` 이전의 생성된 샘플.
this_sample (`torch.Tensor`) : 마지막 predictor `x_{t}` 이후 생성된 샘플.
order (`int`) : 이 단계의 UniC-p의 `p`입니다. 유효한 정확도 차수는 `order + 1`이어야 합니다.
sigma_before (`torch.Tensor`, *선택 사항*) : 노이즈 스케줄에서 이전 단계의 시그마입니다.
sigma (`torch.Tensor`, *선택 사항*) : 노이즈 스케줄에서 현재 단계의 시그마입니다.
**반환값:** `torch.Tensor`
현재 타임스텝에서 보정된 샘플 텐서.
UniC(B(h) 버전)의 한 단계.
#### multistep_uni_p_bh_update[[diffusers.HeliosScheduler.multistep_uni_p_bh_update]]
```python
multistep_uni_p_bh_update(model_output: Tensor, *args, sample: Tensor = None, order: int = None, sigma: Tensor = None, sigma_next: Tensor = None, **kwargs)
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L453)
**매개변수:**
model_output (`torch.Tensor`) : 현재 timestep에서 학습된 diffusion 모델의 직접 출력입니다.
prev_timestep (`int`) : 확산 체인에서 이전의 이산 시간 단계입니다.
sample (`torch.Tensor`) : 확산 과정에서 생성된 샘플의 현재 인스턴스.
order (`int`) : 해당 timestep에서의 UniP 순서 (UniPC-p의 *p*에 해당).
sigma (`torch.Tensor`, *선택 사항*) : 노이즈 스케줄에서 현재 단계의 시그마입니다.
sigma_next (`torch.Tensor`, *선택 사항*) : 노이즈 스케줄에서 다음 단계의 시그마입니다.
**반환값:** `torch.Tensor`
이전 시간 단계의 샘플 텐서.
UniP(B(h) 버전)의 한 단계입니다. 대신, 지정된 경우 `self.solver_p`가 사용됩니다.
#### set_begin_index[[diffusers.HeliosScheduler.set_begin_index]]
```python
set_begin_index(begin_index: int = 0)
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L182)
**매개변수:**
begin_index (`int`) : 스케줄러의 시작 인덱스.
… 스케줄러의 시작 인덱스를 설정합니다. 이 함수는 추론 전에 파이프라인에서 실행해야 합니다.
#### set_timesteps[[diffusers.HeliosScheduler.set_timesteps]]
```python
set_timesteps(num_inference_steps: int, stage_index: int | None = None, device: typing.Union[str, torch.device] = None, sigmas: bool | None = None, mu: bool | None = None, is_amplify_first_chunk: bool = False)
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L195)
각 단계의 timesteps와 sigmas 설정
#### time_shift[[diffusers.HeliosScheduler.time_shift]]
```python
time_shift(mu: float, sigma: float, t: Tensor)
```
[소스](https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_helios.py#L259)
**매개변수:**
mu (`float`) : 시간 시프트를 위한 mu 매개변수.
sigma (`float`) : 시간 시프트를 위한 sigma 매개변수.
t (`torch.Tensor`) : 입력 timesteps.
**반환값:** `torch.Tensor`
시간이 이동된 타임스텝
sigmas에 시간 시프트를 적용합니다.
scheduling_helios

Xet Storage Details

Size:
6.19 kB
·
Xet hash:
438cae338d20d43bccd81248134e3dc1ce4aafb4baafb743906d111dbf05f02f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.