MCPcopy Index your code
hub / github.com/DeepGraphLearning/DiffPack / score

Method score

diffpack/schedule.py:68–77  ·  view source on GitHub ↗
(self, x, sigma)

Source from the content-addressed store, hash-verified

66 self.score_norm_ = (score_norm_table ** 2).mean(0)
67
68 def score(self, x, sigma):
69 x = (x + self.PI) % (2 * self.PI) - self.PI # range from -pi to pi
70 sign = np.sign(x)
71 x = np.log(np.abs(x) / self.PI + 1e-10)
72 x = (x - np.log(self.X_MIN)) / (0 - np.log(self.X_MIN)) * self.X_N
73 x = np.round(np.clip(x, 0, self.X_N)).astype(int)
74 sigma = np.log(sigma / self.PI)
75 sigma = (sigma - np.log(self.SIGMA_MIN)) / (np.log(self.SIGMA_MAX) - np.log(self.SIGMA_MIN)) * self.SIGMA_N
76 sigma = np.round(np.clip(sigma, 0, self.SIGMA_N)).astype(int)
77 return -sign * self.score_[sigma, x]
78
79
80 def p(self, x, sigma):

Callers 2

__init__Method · 0.95
add_noiseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected