We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c79875c commit 4c887d7Copy full SHA for 4c887d7
metric_learn/lfda.py
@@ -139,10 +139,11 @@ def _sum_outer(x):
139
def _eigh(a, b, dim):
140
try:
141
return scipy.sparse.linalg.eigsh(a, k=dim, M=b, which='LA')
142
- except (ValueError, scipy.sparse.linalg.ArpackNoConvergence):
143
- pass
144
- try:
145
- return scipy.linalg.eigh(a, b)
146
except np.linalg.LinAlgError:
147
+ pass # scipy already tried eigh for us
+ except (ValueError, scipy.sparse.linalg.ArpackNoConvergence):
+ try:
+ return scipy.linalg.eigh(a, b)
+ except np.linalg.LinAlgError:
148
+ pass
149
return scipy.linalg.eig(a, b)
0 commit comments