Skip to content

Commit 2b9d20a

Browse files
committed
Merge branch 'master' into general_kernelmatrix
2 parents 764fcd7 + c09ec42 commit 2b9d20a

37 files changed

+129
-56
lines changed

src/KernelFunctions.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export duplicate, set! # Helpers
1010

1111
export Kernel
1212
export ConstantKernel, WhiteKernel, EyeKernel, ZeroKernel
13-
export SqExponentialKernel, ExponentialKernel, GammaExponentialKernel
13+
export SqExponentialKernel, RBFKernel, GaussianKernel, SEKernel
14+
export LaplacianKernel, ExponentialKernel, GammaExponentialKernel
1415
export ExponentiatedKernel
1516
export MaternKernel, Matern32Kernel, Matern52Kernel
1617
export LinearKernel, PolynomialKernel

src/basekernels/constant.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ kappa(κ::ConstantKernel,x::Real) = first(κ.c)*one(x)
6060

6161
metric(::ConstantKernel) = Delta()
6262

63-
Base.show(io::IO, κ::ConstantKernel) = print(io, "Constant Kernel (c = $(first.c)))")
63+
Base.show(io::IO, κ::ConstantKernel) = print(io, "Constant Kernel (c = ", first.c), ")")

src/basekernels/exponential.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ kappa(κ::GammaExponentialKernel, d²::Real) = exp(-d²^first(κ.γ))
6363
iskroncompatible(::GammaExponentialKernel) = true
6464
metric(::GammaExponentialKernel) = SqEuclidean()
6565

66-
Base.show(io::IO, κ::GammaExponentialKernel) = print(io, "Gamma Exponential Kernel (γ = $(first.γ)))")
66+
Base.show(io::IO, κ::GammaExponentialKernel) = print(io, "Gamma Exponential Kernel (γ = ", first.γ), ")")

src/basekernels/fbm.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct FBMKernel{T<:Real} <: BaseKernel
1717
end
1818
end
1919

20-
Base.show(io::IO, κ::FBMKernel) = print(io, "Fractional Brownian Motion Kernel (h = $(first(k.h)))")
20+
Base.show(io::IO, κ::FBMKernel) = print(io, "Fractional Brownian Motion Kernel (h = ", first(κ.h), ")")
2121

2222
const sqroundoff = 1e-15
2323

src/basekernels/gabor.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function _gabor(; ell = nothing, p = nothing)
3030
end
3131

3232
function Base.getproperty(k::GaborKernel, v::Symbol)
33-
if v == :kernel
33+
if v == :kernel
3434
return getfield(k, v)
3535
elseif v == :ell
3636
kernel1 = k.kernel.kernels[1]
@@ -51,7 +51,7 @@ function Base.getproperty(k::GaborKernel, v::Symbol)
5151
end
5252
end
5353

54-
Base.show(io::IO, κ::GaborKernel) = print(io, "Gabor Kernel (ell = $(κ.ell), p = $(κ.p))")
54+
Base.show(io::IO, κ::GaborKernel) = print(io, "Gabor Kernel (ell = ", κ.ell, ", p = ", κ.p, ")")
5555

5656
kappa::GaborKernel, x, y) = kappa.kernel, x ,y)
5757

src/basekernels/maha.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ end
1919
kappa::MahalanobisKernel, d::T) where {T<:Real} = exp(-d)
2020
metric::MahalanobisKernel) = SqMahalanobis.P)
2121

22-
Base.show(io::IO, κ::MahalanobisKernel) = print(io, "Mahalanobis Kernel (size(P) = $(size.P))")
22+
Base.show(io::IO, κ::MahalanobisKernel) = print(io, "Mahalanobis Kernel (size(P) = ", size.P), ")")

src/basekernels/matern.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727

2828
metric(::MaternKernel) = Euclidean()
2929

30-
Base.show(io::IO, κ::MaternKernel) = print(io, "Matern Kernel (ν = $(first.ν)))")
30+
Base.show(io::IO, κ::MaternKernel) = print(io, "Matern Kernel (ν = ", first.ν), ")")
3131

3232
"""
3333
Matern32Kernel()

src/basekernels/periodic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ metric(κ::PeriodicKernel) = Sinus(κ.r)
2424

2525
kappa::PeriodicKernel, d::Real) = exp(- 0.5d)
2626

27-
Base.show(io::IO, κ::PeriodicKernel) = print(io, "Periodic Kernel, length(r) = $(length.r))")
27+
Base.show(io::IO, κ::PeriodicKernel) = print(io, "Periodic Kernel, length(r) = ", length.r), ")")

src/basekernels/piecewisepolynomial.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ end
9595
metric::PiecewisePolynomialKernel) = Mahalanobis.maha)
9696

9797
function Base.show(io::IO, κ::PiecewisePolynomialKernel{V}) where {V}
98-
print(io, "Piecewise Polynomial Kernel (v = $(V), size(maha) = $(size.maha))")
98+
print(io, "Piecewise Polynomial Kernel (v = ", V, ", size(maha) = ", size.maha), ")")
9999
end

src/basekernels/polynomial.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ end
1717
kappa::LinearKernel, xᵀy::Real) = xᵀy + first.c)
1818
metric(::LinearKernel) = DotProduct()
1919

20-
Base.show(io::IO, κ::LinearKernel) = print(io, "Linear Kernel (c = $(first.c)))")
20+
Base.show(io::IO, κ::LinearKernel) = print(io, "Linear Kernel (c = ", first.c), ")")
2121

2222
"""
2323
PolynomialKernel(; d = 2.0, c = 0.0)
@@ -40,4 +40,4 @@ end
4040
kappa::PolynomialKernel, xᵀy::T) where {T<:Real} = (xᵀy + first.c))^(first.d))
4141
metric(::PolynomialKernel) = DotProduct()
4242

43-
Base.show(io::IO, κ::PolynomialKernel) = print(io, "Polynomial Kernel (c = $(first.c)), d = $(first.d)))")
43+
Base.show(io::IO, κ::PolynomialKernel) = print(io, "Polynomial Kernel (c = ", first.c), ", d = ", first.d), ")")

0 commit comments

Comments
 (0)