Skip to content

Commit

Permalink
remove rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Saves committed Dec 2, 2024
1 parent 411fdd8 commit e558c2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion smt/surrogate_models/krg_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,9 @@ def _predict_variances(
A = self.optimal_par["sigma2"]
B = 1.0 - (rt**2.0).sum(axis=0) + (u**2.0).sum(axis=0)
# machine precision: force to zero!
B[B < 1e-12] = 0
if np.min(B) < 1e-13:
warnings.warn("The variance is too small which may raise numerical errors")

s2 = np.einsum("i,j -> ji", A, B)
# Mean Squared Error might be slightly negative depending on
# machine precision: force to zero!
Expand Down

0 comments on commit e558c2e

Please sign in to comment.