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

Method compute_drift

transport/path.py:35–43  ·  view source on GitHub ↗

We always output sde according to score parametrization;

(self, x, t)

Source from the content-addressed store, hash-verified

33 return 1 / t
34
35 def compute_drift(self, x, t):
36 """We always output sde according to score parametrization; """
37 t = expand_t_like_x(t, x)
38 alpha_ratio = self.compute_d_alpha_alpha_ratio_t(t)
39 sigma_t, d_sigma_t = self.compute_sigma_t(t)
40 drift = alpha_ratio * x
41 diffusion = alpha_ratio * (sigma_t ** 2) - sigma_t * d_sigma_t # beta_t in Table 2, from VE-SDE.
42
43 return -drift, diffusion
44
45 def compute_diffusion(self, x, t, form="constant", norm=1.0): #compute w_t in Eq 4.
46 """Compute the diffusion term of the SDE

Callers 5

compute_diffusionMethod · 0.95
training_lossesMethod · 0.45
score_odeMethod · 0.45
noise_odeMethod · 0.45

Calls 3

compute_sigma_tMethod · 0.95
expand_t_like_xFunction · 0.85

Tested by

no test coverage detected