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

Class GVPCPlan

transport/path.py:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173
174class GVPCPlan(ICPlan):
175 def __init__(self, sigma=0.0):
176 super().__init__(sigma)
177
178 def compute_alpha_t(self, t):
179 """Compute coefficient of x1"""
180 alpha_t = th.sin(t * np.pi / 2)
181 d_alpha_t = np.pi / 2 * th.cos(t * np.pi / 2)
182 return alpha_t, d_alpha_t
183
184 def compute_sigma_t(self, t):
185 """Compute coefficient of x0"""
186 sigma_t = th.cos(t * np.pi / 2)
187 d_sigma_t = -np.pi / 2 * th.sin(t * np.pi / 2)
188 return sigma_t, d_sigma_t
189
190 def compute_d_alpha_alpha_ratio_t(self, t):
191 """Special purposed function for computing numerical stabled d_alpha_t / alpha_t"""
192 return np.pi / (2 * th.tan(t * np.pi / 2))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected