Skip to content

Commit 0c53e30

Browse files
0.36.1
1 parent c99aacc commit 0c53e30

4 files changed

Lines changed: 367 additions & 130 deletions

File tree

notebooks/spot_aquisition_random_rosenbrock_2d.ipynb

Lines changed: 360 additions & 123 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotpython"
10-
version = "0.36.0"
10+
version = "0.36.1"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotpython/surrogate/kernels.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from sklearn.gaussian_process.kernels import Kernel, NormalizedKernelMixin, Hyperparameter
33

44

5-
def _correlation(kernel, D, kernel_params=None):
5+
def _spot_correlation(kernel, D, kernel_params=None):
66
"""
77
Dispatches to the selected kernel function.
88
Args:
@@ -49,7 +49,7 @@ def _correlation(kernel, D, kernel_params=None):
4949
raise ValueError(f"Unknown kernel: {kernel}")
5050

5151

52-
# Example: Custom sklearn-compatible RBF kernel using _correlation
52+
# Example: Custom sklearn-compatible RBF kernel using _spot_correlation
5353
class CustomRBF(NormalizedKernelMixin, Kernel):
5454
def __init__(self, length_scale=1.0, length_scale_bounds=(1e-5, 1e5)):
5555
self.length_scale = length_scale
@@ -61,7 +61,7 @@ def hyperparameter_length_scale(self):
6161

6262
def __call__(self, D, eval_gradient=False):
6363
# D is assumed to be the squared distance matrix
64-
K = _correlation("gauss", D)
64+
K = _spot_correlation("gauss", D)
6565
if eval_gradient:
6666
# Gradient not implemented
6767
return K, np.empty((K.shape[0], K.shape[1], 0))
@@ -85,7 +85,7 @@ def hyperparameter_length_scale(self):
8585
return Hyperparameter("length_scale", "numeric", self.length_scale_bounds)
8686

8787
def __call__(self, D, eval_gradient=False):
88-
K = _correlation("matern", D, {"nu": self.nu})
88+
K = _spot_correlation("matern", D, {"nu": self.nu})
8989
if eval_gradient:
9090
# Gradient not implemented
9191
return K, np.empty((K.shape[0], K.shape[1], 0))

src/spotpython/surrogate/kriging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from numpy import linspace, append
99
from scipy.spatial.distance import cdist, pdist, squareform
1010
from spotpython.surrogate.plot import plotkd
11-
from spotpython.surrogate.kernels import _correlation # Only import _correlation
11+
from spotpython.surrogate.kernels import _spot_correlation
1212

1313

1414
# --- The New Kriging Class with Nyström Approximation as introduced in v0.34.0 ---
@@ -222,7 +222,7 @@ def _correlation(self, D):
222222
Returns:
223223
np.ndarray: Correlation matrix.
224224
"""
225-
return _correlation(self.kernel, D, self.kernel_params)
225+
return _spot_correlation(self.kernel, D, self.kernel_params)
226226

227227
# -------- Basis correlation construction (identical to kriging.py) --------
228228

0 commit comments

Comments
 (0)