(self, x, t, t_next, r1=1 / 3, r2=2 / 3, eps_cache=None)
| 378 | return x_2, eps_cache |
| 379 | |
| 380 | def dpm_solver_3_step(self, x, t, t_next, r1=1 / 3, r2=2 / 3, eps_cache=None): |
| 381 | eps_cache = {} if eps_cache is None else eps_cache |
| 382 | h = t_next - t |
| 383 | eps, eps_cache = self.eps(eps_cache, 'eps', x, t) |
| 384 | s1 = t + r1 * h |
| 385 | s2 = t + r2 * h |
| 386 | u1 = x - self.sigma(s1) * (r1 * h).expm1() * eps |
| 387 | eps_r1, eps_cache = self.eps(eps_cache, 'eps_r1', u1, s1) |
| 388 | u2 = x - self.sigma(s2) * (r2 * h).expm1() * eps - self.sigma(s2) * (r2 / r1) * ((r2 * h).expm1() / (r2 * h) - 1) * (eps_r1 - eps) |
| 389 | eps_r2, eps_cache = self.eps(eps_cache, 'eps_r2', u2, s2) |
| 390 | x_3 = x - self.sigma(t_next) * h.expm1() * eps - self.sigma(t_next) / r2 * (h.expm1() / h - 1) * (eps_r2 - eps) |
| 391 | return x_3, eps_cache |
| 392 | |
| 393 | def dpm_solver_fast(self, x, t_start, t_end, nfe, eta=0., s_noise=1., noise_sampler=None): |
| 394 | noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler |
no test coverage detected