Skip to content

Commit 0867f29

Browse files
Fix kernel matrix functions for ScaledKernel (#261)
1 parent 600df21 commit 0867f29

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "KernelFunctions"
22
uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
3-
version = "0.8.24"
3+
version = "0.8.25"
44

55
[deps]
66
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"

src/kernels/scaledkernel.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ end
4040
function kernelmatrix!(
4141
K::AbstractMatrix, κ::ScaledKernel, x::AbstractVector, y::AbstractVector
4242
)
43-
kernelmatrix!(K, κ, x, y)
43+
kernelmatrix!(K, κ.kernel, x, y)
4444
K .*= κ.σ²
4545
return K
4646
end
4747

4848
function kernelmatrix!(K::AbstractMatrix, κ::ScaledKernel, x::AbstractVector)
49-
kernelmatrix!(K, κ, x)
49+
kernelmatrix!(K, κ.kernel, x)
5050
K .*= κ.σ²
5151
return K
5252
end
5353

5454
function kernelmatrix_diag!(K::AbstractVector, κ::ScaledKernel, x::AbstractVector)
55-
kernelmatrix_diag!(K, κ, x)
55+
kernelmatrix_diag!(K, κ.kernel, x)
5656
K .*= κ.σ²
5757
return K
5858
end

test/kernels/scaledkernel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@test ks(x, y) == (s * k)(x, y)
1111

1212
# Standardised tests.
13-
TestUtils.test_interface(k, Float64)
13+
TestUtils.test_interface(ks, Float64)
1414
test_ADs(x -> exp(x[1]) * SqExponentialKernel(), rand(1))
1515

1616
test_params(s * k, (k, [s]))

0 commit comments

Comments
 (0)