@@ -42,7 +42,7 @@ plot!(x_test, sinc; label="true function")
4242# A simple way to ensure that the kernel parameters are positive
4343# is to optimize over the logarithm of the parameters.
4444
45- function kernelcall (θ)
45+ function kernel_creator (θ)
4646 return (exp (θ[1 ]) * SqExponentialKernel () + exp (θ[2 ]) * Matern32Kernel ()) ∘
4747 ScaleTransform (exp (θ[3 ]))
4848end
@@ -52,7 +52,7 @@ nothing #hide
5252# the kernel parameters and normalization constant:
5353
5454function f (x, x_train, y_train, θ)
55- k = kernelcall (θ[1 : 3 ])
55+ k = kernel_creator (θ[1 : 3 ])
5656 return kernelmatrix (k, x, x_train) *
5757 ((kernelmatrix (k, x_train) + exp (θ[4 ]) * I) \ y_train)
5858end
@@ -133,15 +133,15 @@ raw_initial_θ = (
133133flat_θ, unflatten = ParameterHandling. value_flatten (raw_initial_θ)
134134flat_θ # hide
135135
136- # We define a few relevant functions and note that compared to the previous `kernelcall ` function, we do not need explicit `exp`s.
136+ # We define a few relevant functions and note that compared to the previous `kernel_creator ` function, we do not need explicit `exp`s.
137137
138- function kernelcall (θ)
138+ function kernel_creator (θ)
139139 return (θ. k1 * SqExponentialKernel () + θ. k2 * Matern32Kernel ()) ∘ ScaleTransform (θ. k3)
140140end
141141nothing # hide
142142
143143function f (x, x_train, y_train, θ)
144- k = kernelcall (θ)
144+ k = kernel_creator (θ)
145145 return kernelmatrix (k, x, x_train) *
146146 ((kernelmatrix (k, x_train) + θ. noise_var * I) \ y_train)
147147end
0 commit comments