Skip to content

Commit

Permalink
bug: need argmax(abs(eigenvalues))
Browse files Browse the repository at this point in the history
  • Loading branch information
swo committed Nov 27, 2024
1 parent f7c90ad commit 82470dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ngm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def dominant_eigen(X: np.array, norm: str = "L1") -> namedtuple:
# do the eigenvalue analysis
e = np.linalg.eig(X)
# which eigenvalue is the dominant one?
i = np.argmax(e.eigenvalues)
i = np.argmax(np.abs(e.eigenvalues))

value = e.eigenvalues[i]
vector = _ensure_positive_array(e.eigenvectors[:, i])
Expand Down

0 comments on commit 82470dd

Please sign in to comment.