MCPcopy Create free account
hub / github.com/DeepGraphLearning/DiffPack / p

Method p

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

Source from the content-addressed store, hash-verified

78
79
80 def p(self, x, sigma):
81 x = (x + self.PI) % (2 * self.PI) - self.PI
82 x = np.log(np.abs(x) / self.PI + 1e-10)
83 x = (x - np.log(self.X_MIN)) / (0 - np.log(self.X_MIN)) * self.X_N
84 x = np.round(np.clip(x, 0, self.X_N)).astype(int)
85 sigma = np.log(sigma / self.PI)
86 sigma = (sigma - np.log(self.SIGMA_MIN)) / (np.log(self.SIGMA_MAX) - np.log(self.SIGMA_MIN)) * self.SIGMA_N
87 sigma = np.round(np.clip(sigma, 0, self.SIGMA_N)).astype(int)
88 return self.p_[sigma, x]
89
90 def score_norm(self, sigma):
91 if type(sigma) == torch.Tensor:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected