Skip to content

Commit 3949cbf

Browse files
committed
gp: add gp demos
* small change to gp.kernel that fixes a bug in MatrixKernel
1 parent fb74b17 commit 3949cbf

File tree

4 files changed

+1143
-5
lines changed

4 files changed

+1143
-5
lines changed

UncertainSCI/gp/kernel.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,15 @@ def __call__(self, x: np.ndarray, y: np.ndarray | None = None,
335335

336336
# TODO: add dim checks on x, y
337337
# TODO: use ignore_close_y
338-
return self._core(x, y if y is not None else x)
338+
return self._core(x, y)
339339

340-
def _core(self, x: np.ndarray, y: np.ndarray) -> np.ndarray:
340+
def _core(self, x: np.ndarray, y: np.ndarray | None = None) -> np.ndarray:
341341
"""Bivariate matrix-valued kernel function.
342342
343343
Arguments:
344344
x (2-d array):
345345
x coordinates over which to evaluate kernel
346-
y (2-d array):
346+
y (2-d array or None):
347347
y coordinates over which to evaluate kernel
348348
349349
Returns:
@@ -394,13 +394,13 @@ def __init__(self, dim: int, cdim: int, a: np.ndarray, k: ScalarKernel):
394394
self.a = a
395395
self.k = k
396396

397-
def _core(self, x: np.ndarray, y: np.ndarray) -> np.ndarray:
397+
def _core(self, x: np.ndarray, y: np.ndarray | None = None) -> np.ndarray:
398398
"""Evaluate simple Kronecker kernel.
399399
400400
Arguments:
401401
x (2-d array):
402402
x coordinates over which to evaluate kernel
403-
y (2-d array):
403+
y (2-d array or None):
404404
y coordinates over which to evaluate kernel
405405
406406
Returns:

0 commit comments

Comments
 (0)