diff --git a/Project.toml b/Project.toml index 24da5ddcc..249f032ec 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "KernelFunctions" uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392" -version = "0.10.63" +version = "0.10.64" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/src/basekernels/periodic.jl b/src/basekernels/periodic.jl index 2758d7f94..aeadf5e5a 100644 --- a/src/basekernels/periodic.jl +++ b/src/basekernels/periodic.jl @@ -34,7 +34,7 @@ PeriodicKernel(T::DataType, dims::Int=1) = PeriodicKernel(; r=ones(T, dims)) metric(κ::PeriodicKernel) = Sinus(κ.r) -kappa(::PeriodicKernel, d::Real) = exp(-0.5d) +kappa(::PeriodicKernel, d::Real) = exp(-d / 2) function Base.show(io::IO, κ::PeriodicKernel) return print(io, "Periodic Kernel, length(r) = $(length(κ.r))") diff --git a/test/basekernels/periodic.jl b/test/basekernels/periodic.jl index 540947b1b..c33569714 100644 --- a/test/basekernels/periodic.jl +++ b/test/basekernels/periodic.jl @@ -8,6 +8,7 @@ @test k(v1, v2) ≈ exp(-0.5 * sum(abs2, sinpi.(v1 - v2) ./ r)) @test k(v1, v2) == k(v2, v1) @test PeriodicKernel(3)(v1, v2) == PeriodicKernel(; r=ones(3))(v1, v2) + @test PeriodicKernel(; r=Float32.(r))(Float32.(v1), Float32.(v2)) isa Float32 @test repr(k) == "Periodic Kernel, length(r) = $(length(r))" # Standardised tests.