(t, logsnr_min, logsnr_max)
| 356 | """Draws samples from an interpolated cosine timestep distribution (from simple diffusion).""" |
| 357 | |
| 358 | def logsnr_schedule_cosine(t, logsnr_min, logsnr_max): |
| 359 | t_min = math.atan(math.exp(-0.5 * logsnr_max)) |
| 360 | t_max = math.atan(math.exp(-0.5 * logsnr_min)) |
| 361 | return -2 * torch.log(torch.tan(t_min + t * (t_max - t_min))) |
| 362 | |
| 363 | def logsnr_schedule_cosine_shifted(t, image_d, noise_d, logsnr_min, logsnr_max): |
| 364 | shift = 2 * math.log(noise_d / image_d) |
no outgoing calls
no test coverage detected