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

Function get_ancestral_step

k_diffusion/sampling.py:51–58  ·  view source on GitHub ↗

Calculates the noise level (sigma_down) to step down to and the amount of noise to add (sigma_up) when doing an ancestral sampling step.

(sigma_from, sigma_to, eta=1.)

Source from the content-addressed store, hash-verified

49
50
51def get_ancestral_step(sigma_from, sigma_to, eta=1.):
52 """Calculates the noise level (sigma_down) to step down to and the amount
53 of noise to add (sigma_up) when doing an ancestral sampling step."""
54 if not eta:
55 return sigma_to, 0.
56 sigma_up = min(sigma_to, eta * (sigma_to ** 2 * (sigma_from ** 2 - sigma_to ** 2) / sigma_from ** 2) ** 0.5)
57 sigma_down = (sigma_to ** 2 - sigma_up ** 2) ** 0.5
58 return sigma_down, sigma_up
59
60
61def default_noise_sampler(x):

Callers 6

sample_euler_ancestralFunction · 0.85
sample_dpm_2_ancestralFunction · 0.85
dpm_solver_fastMethod · 0.85
dpm_solver_adaptiveMethod · 0.85
sample_dpmpp_sdeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected