Skip to content

Commit

Permalink
minor revision
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaxiangYi96 committed Nov 20, 2023
1 parent df3b7a1 commit 6b6c030
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/mfpml/models/gaussian_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(
regr: Any = Ordinary(),
optimizer: Any = None,
noise_prior: float = None,
optimzer_restart: int = 0,
) -> None:

# get the dimension of the problem
Expand All @@ -35,6 +36,7 @@ def __init__(
self.kernel = kernel
# optimizer
self.optimizer = optimizer
self.optimizer_restart = optimzer_restart

# basis function
self.regr = regr
Expand Down Expand Up @@ -142,7 +144,7 @@ def _hyper_paras_optimization(self) -> None:

if self.optimizer is None:
# use L-BFGS-B method in scipy
n_trials = 20
n_trials = self.optimizer_restart + 1
optimum_value = float("inf")
for _ in range(n_trials):
# initial point
Expand Down Expand Up @@ -243,7 +245,7 @@ def _update_kernel_matrix(self) -> None:
self.K = self.kernel.get_kernel_matrix(
self.sample_scaled_x,
self.sample_scaled_x) + np.eye(self.num_samples) * self.noise**2
self.L = cholesky(self.K, lower=True)
self.L = cholesky(self.K)

# step 1: get the optimal beta
# f, basis function
Expand Down
1 change: 0 additions & 1 deletion src/mfpml/models/kernels.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
from numba import float32, int32 # import the types
from scipy.spatial.distance import cdist


Expand Down
1 change: 0 additions & 1 deletion src/mfpml/models/kriging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Any

import numpy as np
from numba import jit
from numpy.linalg import cholesky, solve
from scipy.optimize import minimize

Expand Down

0 comments on commit 6b6c030

Please sign in to comment.