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)
| 206 | |
| 207 | |
| 208 | def get_ancestral_step(sigma_from, sigma_to): |
| 209 | """Calculates the noise level (sigma_down) to step down to and the amount |
| 210 | of noise to add (sigma_up) when doing an ancestral sampling step.""" |
| 211 | sigma_up = (sigma_to**2 * (sigma_from**2 - sigma_to**2) / sigma_from**2) ** 0.5 |
| 212 | sigma_down = (sigma_to**2 - sigma_up**2) ** 0.5 |
| 213 | return sigma_down, sigma_up |
| 214 | |
| 215 | |
| 216 | @th.no_grad() |
no outgoing calls
no test coverage detected