@@ -42,7 +42,7 @@ plot!(x_test, sinc; label="true function")
42
42
# A simple way to ensure that the kernel parameters are positive
43
43
# is to optimize over the logarithm of the parameters.
44
44
45
- function kernelcall (θ)
45
+ function kernel_creator (θ)
46
46
return (exp (θ[1 ]) * SqExponentialKernel () + exp (θ[2 ]) * Matern32Kernel ()) ∘
47
47
ScaleTransform (exp (θ[3 ]))
48
48
end
@@ -52,7 +52,7 @@ nothing #hide
52
52
# the kernel parameters and normalization constant:
53
53
54
54
function f (x, x_train, y_train, θ)
55
- k = kernelcall (θ[1 : 3 ])
55
+ k = kernel_creator (θ[1 : 3 ])
56
56
return kernelmatrix (k, x, x_train) *
57
57
((kernelmatrix (k, x_train) + exp (θ[4 ]) * I) \ y_train)
58
58
end
@@ -133,15 +133,15 @@ raw_initial_θ = (
133
133
flat_θ, unflatten = ParameterHandling. value_flatten (raw_initial_θ)
134
134
flat_θ # hide
135
135
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.
137
137
138
- function kernelcall (θ)
138
+ function kernel_creator (θ)
139
139
return (θ. k1 * SqExponentialKernel () + θ. k2 * Matern32Kernel ()) ∘ ScaleTransform (θ. k3)
140
140
end
141
141
nothing # hide
142
142
143
143
function f (x, x_train, y_train, θ)
144
- k = kernelcall (θ)
144
+ k = kernel_creator (θ)
145
145
return kernelmatrix (k, x, x_train) *
146
146
((kernelmatrix (k, x_train) + θ. noise_var * I) \ y_train)
147
147
end
0 commit comments