Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

(Most) Matern kernels return Float64 for Float32 inputs

Open Beginner friendly
#609 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
julia

Research direction

Start in src/basekernels/matern.jl at the cited Matern kernel definitions and compare their behavior with Matern12Kernel for Float32 inputs. Run the existing test suite and add or update focused coverage so the affected kernels preserve the input precision if that is the intended behavior.

Written by the indexing model from the issue text.

Description

Hello. When I run typeof(Matern52Kernel()(Float32(1), Float32(1.1))), I get Float64. Same with Matern32Kernel, Matern72Kernel and MaternKernel. Only Matern12Kernel outputs a Float32 with Float32 inputs. Is this on purpose?

It might be stemming from, e.g., the sqrt(5) in https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/blob/be3b6847bff2c2ac4e548dcc294cbe2f2864f406/src/basekernels/matern.jl#L114 which always evaluates to a Float64. Same for all the other Matern kernels affected. If it's not intentional, it seems like a simple fix.

Dominant language
Julia
Stars
276
Forks
41
Avg merge
1d 13h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaGaussianProcesses/KernelFunctions.jl

All issues in JuliaGaussianProcesses/KernelFunctions.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.