A variety of logarithmic integrators, method for empty cache, analytic jacobians for UV and IR parameter #3
Open
Jpwessely wants to merge 2 commits into
Open
A variety of logarithmic integrators, method for empty cache, analytic jacobians for UV and IR parameter #3Jpwessely wants to merge 2 commits into
Jpwessely wants to merge 2 commits into
Conversation
…y.py regarding the cache, added analytic parrameter gradients for kernels with asymptotics
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds analytic hyperparameter gradients for the asymptotic kernel and introduces logarithmic / semi-infinite quadrature integrators to better handle wide dynamic ranges and UV-tail behavior.
Changes:
- Add
_empty_cache()andparams_gradient()to the asymptotic kernel wrapper. - Introduce
Riemann_1D_log,GaussLegendre_1D_log,GaussLegendre_1D_log_UVtail, andGaussLegendre_1D_semiinfintegrators.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| fredipy/kernels.py | Adds cache invalidation and analytic gradients for AsymptoticKernel hyperparameters. |
| fredipy/integrators.py | Adds new log-grid and semi-infinite Gauss-Legendre-based integration strategies (incl. UV tail correction). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+281
to
+285
| def _empty_cache(self) -> None: | ||
| """Clear this kernel's cache and propagate to the inner kernel.""" | ||
| self._K_asymp = None | ||
| self._x, self._y = np.array([None]), np.array([None]) | ||
| self.kernel._empty_cache() |
Comment on lines
+420
to
+423
| tau_x = softtheta(x1, self.mu_ir, self.l_ir, -self.ir) # σ_+(x;ir) | ||
| tau_y = softtheta(y1, self.mu_ir, self.l_ir, -self.ir) | ||
| sig_x = softtheta(x1, self.mu_uv, self.l_uv, -self.uv) # σ_-(x;uv) | ||
| sig_y = softtheta(y1, self.mu_uv, self.l_uv, -self.uv) |
| grads.append(_wrap) | ||
|
|
||
| # ---- UV asymptotic parameter gradients: mu_uv, l_uv ---------------- | ||
| if self.uv: |
Comment on lines
+299
to
+308
| def singleIntegration( | ||
| self, | ||
| constraint: LinearEquality, | ||
| kernel: Callable, | ||
| w_pred: np.ndarray | ||
| ) -> np.ndarray: | ||
| return ( | ||
| self.weights * constraint(make_row_vector(self.w), x=make_column_vector(constraint.x)) | ||
| @ kernel(self.w, w_pred) | ||
| ) |
Comment on lines
+376
to
+379
| # correction_{mn} = T (A_m + A_n) + T² | ||
| ones_col = np.ones((A.shape[0], 1)) | ||
| correction = self.T_uv * (A @ ones_col.T + ones_col @ A.T) + self.T_uv ** 2 | ||
| return bulk + correction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fredipy_diff_doc.md
For the Integrator that includes the UV tail: it works only for the gluon, I left it in for you to see it but in the current form its to specific.