(xt, noise, t, next_t, beta, eta=0)
| 64 | |
| 65 | |
| 66 | def p_xt(xt, noise, t, next_t, beta, eta=0): |
| 67 | at = compute_alpha(beta.cuda(), t.long()) |
| 68 | at_next = compute_alpha(beta, next_t.long()) |
| 69 | x0_t = (xt - noise * (1 - at).sqrt()) / at.sqrt() |
| 70 | c1 = (eta * ((1 - at / at_next) * (1 - at_next) / (1 - at)).sqrt()) |
| 71 | c2 = ((1 - at_next) - c1 ** 2).sqrt() |
| 72 | eps = torch.randn(xt.shape, device=xt.device) |
| 73 | xt_next = at_next.sqrt() * x0_t + c1 * eps + c2 * noise |
| 74 | return xt_next |
| 75 | |
| 76 | |
| 77 | def divide_grids(boundary, grids_num): |
nothing calls this directly
no test coverage detected