Skip to content

Commit 8512e16

Browse files
authored
Adjust thresholds (#30)
* Lower threshold for checking after row-swap * Relax check for stat. dist. invariance
1 parent 05fa05c commit 8512e16

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pygpcca/_gpcca.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def _gram_schmidt_mod(X: np.ndarray, eta: np.ndarray) -> np.ndarray:
132132
X[:, 0] = np.sqrt(eta)
133133
# Raise, if the subspace changed!
134134
dummy = subspace_angles(X, Xc)
135-
if not np.allclose(dummy, 0.0, atol=1e-8, rtol=1e-5):
135+
if not np.allclose(dummy, 0.0, atol=1e-7, rtol=1e-5):
136136
logging.error(Xc)
137137
logging.error(X)
138138
raise ValueError(
@@ -153,7 +153,7 @@ def _gram_schmidt_mod(X: np.ndarray, eta: np.ndarray) -> np.ndarray:
153153

154154
# Raise, if the subspace changed!
155155
dummy = subspace_angles(Q, Xc)
156-
if not np.allclose(dummy, 0.0, atol=1e-8, rtol=1e-5):
156+
if not np.allclose(dummy, 0.0, atol=1e-7, rtol=1e-5):
157157
raise ValueError(
158158
"The subspace of Q derived by eta-orthogonalization doesn't match the "
159159
f"subspace of the original Q! The subspace angles are: {dummy}. "

pygpcca/utils/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def _is_stationary_distribution(T: Union[np.ndarray, spmatrix], pi: np.ndarray)
416416
raise ValueError("Shape mismatch.")
417417

418418
# check for invariance
419-
if not np.allclose(T.T.dot(pi), pi, rtol=1e4 * EPS, atol=1e4 * EPS):
419+
if not np.allclose(T.T.dot(pi), pi, rtol=1e6 * EPS, atol=1e6 * EPS):
420420
dev = np.max(np.abs(T.T.dot(pi) - pi))
421421
raise ValueError(
422422
f"Stationary distribution is not invariant under the transition matrix. Maximal deviation = " f"{dev}"

0 commit comments

Comments
 (0)