MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / get_sigmas_karras

Function get_sigmas_karras

k_diffusion/sampling.py:17–23  ·  view source on GitHub ↗

Constructs the noise schedule of Karras et al. (2022).

(n, sigma_min, sigma_max, rho=7., device='cpu')

Source from the content-addressed store, hash-verified

15
16
17def get_sigmas_karras(n, sigma_min, sigma_max, rho=7., device='cpu'):
18 """Constructs the noise schedule of Karras et al. (2022)."""
19 ramp = torch.linspace(0, 1, n)
20 min_inv_rho = sigma_min ** (1 / rho)
21 max_inv_rho = sigma_max ** (1 / rho)
22 sigmas = (max_inv_rho + ramp * (min_inv_rho - max_inv_rho)) ** rho
23 return append_zero(sigmas).to(device)
24
25
26def get_sigmas_exponential(n, sigma_min, sigma_max, device='cpu'):

Callers

nothing calls this directly

Calls 1

append_zeroFunction · 0.85

Tested by

no test coverage detected