Skip to content

Commit 3c52a39

Browse files
michalk8msmdev
andauthored
Adjust chi threshold (#34)
* Adjust chi threshold to -1e4*EPS Co-authored-by: Bernhard Reuter <43750470+msmdev@users.noreply.github.com>
1 parent 8512e16 commit 3c52a39

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pygpcca/_gpcca.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def _opt_soft(X: np.ndarray, rot_matrix: np.ndarray) -> Tuple[np.ndarray, np.nda
530530

531531
# Check for negative elements in chi and handle them.
532532
if np.any(chi < 0.0):
533-
if np.any(chi < -10 * EPS):
533+
if np.any(chi < -1e4 * EPS):
534534
min_el = np.min(chi)
535535
raise ValueError(f"Some elements of chi are significantly negative. The minimal element in chi is {min_el}")
536536
else:
@@ -539,7 +539,7 @@ def _opt_soft(X: np.ndarray, rot_matrix: np.ndarray) -> Tuple[np.ndarray, np.nda
539539
if not np.allclose(np.sum(chi, axis=1), 1.0, atol=1e-8, rtol=1e-5):
540540
dev = np.max(np.abs(np.sum(chi, axis=1) - 1.0))
541541
raise ValueError(
542-
f"The rows of chi don't sum up to 1.0 after rescaling. Maximum deviation from 1 is " f"{dev}"
542+
f"The rows of chi don't sum up to 1.0 after rescaling. Maximum deviation from 1 is {dev}"
543543
)
544544

545545
return rot_matrix, chi, fopt

0 commit comments

Comments
 (0)