mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
Exception fixes for Python 3 compat
This commit is contained in:
parent
74f8caba2b
commit
c6b43d91da
8 changed files with 10 additions and 10 deletions
|
|
@ -91,7 +91,7 @@ def jitchol(A, maxtries=5):
|
|||
else:
|
||||
diagA = np.diag(A)
|
||||
if np.any(diagA <= 0.):
|
||||
raise linalg.LinAlgError, "not pd: non-positive diagonal elements"
|
||||
raise linalg.LinAlgError("not pd: non-positive diagonal elements")
|
||||
jitter = diagA.mean() * 1e-6
|
||||
num_tries = 1
|
||||
while num_tries <= maxtries and np.isfinite(jitter):
|
||||
|
|
@ -105,7 +105,7 @@ def jitchol(A, maxtries=5):
|
|||
import traceback
|
||||
logging.warning('\n'.join(['Added {} rounds of jitter, jitter of {:.10e}'.format(num_tries-1, jitter),
|
||||
' in '+traceback.format_list(traceback.extract_stack(limit=2)[-2:-1])[0][2:]]))
|
||||
raise linalg.LinAlgError, "not positive definite, even with jitter."
|
||||
raise linalg.LinAlgError("not positive definite, even with jitter.")
|
||||
|
||||
# def dtrtri(L, lower=1):
|
||||
# """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue