8000 Revert einsum optimization · scikit-learn/scikit-learn@d698126 · GitHub
[go: up one dir, main page]

Skip to content

Commit d698126

Browse files
Minghui Liuminghui-liu
Minghui Liu
authored andcommitted
Revert einsum optimization
1 parent 37a9fde commit d698126

File tree

1 file changed

+1
-2
lines changed
  • sklearn/gaussian_process

1 file changed

+1
-2
lines changed

sklearn/gaussian_process/gpr.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ def predict(self, X, return_std=False, return_cov=False):
332332

333333
# Compute variance of predictive 6B16 distribution
334334
y_var = self.kernel_.diag(X)
335-
sum1 = np.dot(K_trans, self._K_inv).T
336-
y_var -= np.einsum("ki,ik->k", K_trans, sum1)
335+
y_var -= np.einsum("ij,ij->i", np.dot(K_trans, self._K_inv), K_trans)
337336

338337
# Check if any of the variances is negative because of
339338
# numerical issues. If yes: set the variance to 0.

0 commit comments

Comments
 (0)
0