MCPcopy Index your code
hub / github.com/CompVis/diff2flow / get_velocity_from_score

Method get_velocity_from_score

diff2flow/flow.py:151–161  ·  view source on GitHub ↗

Wrapper function: transfrom score prediction model to velocity Args: score: [batch_dim, ...] shaped tensor; score model output x: [batch_dim, ...] shaped tensor; x_t data point t: [batch_dim,] time tensor

(self, score, x, t)

Source from the content-addressed store, hash-verified

149 return noise
150
151 def get_velocity_from_score(self, score, x, t):
152 """Wrapper function: transfrom score prediction model to velocity
153 Args:
154 score: [batch_dim, ...] shaped tensor; score model output
155 x: [batch_dim, ...] shaped tensor; x_t data point
156 t: [batch_dim,] time tensor
157 """
158 t = pad_v_like_x(t, x)
159 drift, var = self.compute_drift(x, t)
160 velocity = var * score - drift
161 return velocity
162
163
164class GVPSchedule(LinearSchedule):

Callers

nothing calls this directly

Calls 2

compute_driftMethod · 0.95
pad_v_like_xFunction · 0.85

Tested by

no test coverage detected