Skip to content

Matern32Kernel and Matern52Kernel keep Float32 - #610

Merged
theogf merged 3 commits into
JuliaGaussianProcesses:masterfrom
ParadaCarleton:matern-float-constants
Oct 10, 2026
Merged

theogf merged 3 commits into
JuliaGaussianProcesses:masterfrom
ParadaCarleton:matern-float-constants

Conversation

@ParadaCarleton

Copy link
Copy Markdown
Contributor

The kappa of Matern32Kernel and Matern52Kernel multiplies by sqrt(3) and sqrt(5), which are Float64, so a Float32 kernel matrix (and any GP built on it) is promoted to Float64. This PR forms the constant at the distance's type (sqrt(5 * one(d))), the same fix #560 made for PeriodicKernel. Float64 results are unchanged, and each kernel gets a test that its kappa of a Float32 is a Float32.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.52%. Comparing base (d8c0d30) to head (8613ac0).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #610       +/-   ##
===========================================
+ Coverage   68.61%   93.52%   +24.91%     
===========================================
  Files          52       52               
  Lines        1453     1468       +15     
===========================================
+ Hits          997     1373      +376     
+ Misses        456       95      -361     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/basekernels/matern.jl Resolved
Comment thread src/basekernels/matern.jl Resolved
@theogf

theogf commented Oct 10, 2026

Copy link
Copy Markdown
Member

Thanks for addressing the points, LGTM

@theogf
theogf merged commit e83e193 into JuliaGaussianProcesses:master Oct 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants