MCPcopy Create free account
hub / github.com/CompVis/diff2flow / compute_drift

Method compute_drift

diff2flow/flow.py:86–94  ·  view source on GitHub ↗

We always output sde according to score parametrization;

(self, x, t)

Source from the content-addressed store, hash-verified

84 return 1 / t
85
86 def compute_drift(self, x, t):
87 """We always output sde according to score parametrization; """
88 t = pad_v_like_x(t, x)
89 alpha_ratio = self.compute_d_alpha_alpha_ratio_t(t)
90 sigma_t, d_sigma_t = self.compute_sigma_t(t)
91 drift = alpha_ratio * x
92 diffusion = alpha_ratio * (sigma_t ** 2) - sigma_t * d_sigma_t
93
94 return -drift, diffusion
95
96 def compute_diffusion(self, x, t, form="constant", norm=1.0):
97 """Compute the diffusion term of the SDE

Callers 2

compute_diffusionMethod · 0.95

Calls 3

compute_sigma_tMethod · 0.95
pad_v_like_xFunction · 0.85

Tested by

no test coverage detected