Skip to content

Commit

Permalink
Add option to have a single isotropic lscale
Browse files Browse the repository at this point in the history
  • Loading branch information
ziatdinovmax committed Apr 12, 2020
1 parent d9da5ae commit 2232901
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gpim/gpreg/gpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ def __init__(self,
input_dim = np.ndim(y)
self.X, self.y = gprutils.prepare_training_data(X, y)
self.do_sparse = sparse
if lengthscale is None:
if lengthscale is None and kwargs.get("isotropic") is None:
lengthscale = [[0. for l in range(input_dim)],
[np.mean(y.shape) / 2 for l in range(input_dim)]]
[np.mean(y.shape) / 2 for l in range(input_dim)]] # TODO Make separate lscale for each dim
elif lengthscale is None and kwargs.get("isotropic"):
lengthscale = [0., np.mean(y.shape) / 2]
kernel = pyro_kernels.get_kernel(
kernel, input_dim, lengthscale, use_gpu,
amplitude=kwargs.get('amplitude'))
Expand Down

0 comments on commit 2232901

Please sign in to comment.