(self, x, sigma)
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected