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