MCPcopy Create free account
hub / github.com/Yasoz/DiffTraj / p_xt

Function p_xt

utils/utils.py:66–74  ·  view source on GitHub ↗
(xt, noise, t, next_t, beta, eta=0)

Source from the content-addressed store, hash-verified

64
65
66def 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
77def divide_grids(boundary, grids_num):

Callers

nothing calls this directly

Calls 1

compute_alphaFunction · 0.85

Tested by

no test coverage detected