diff --git a/BayesValidRox/BayesInference/MCMC.py b/BayesValidRox/BayesInference/MCMC.py index ae6bb7ba6128d509e3b7c80326d382e976fd7683..74a6190c87272534ec305e1c8e245e7823fafc7c 100755 --- a/BayesValidRox/BayesInference/MCMC.py +++ b/BayesValidRox/BayesInference/MCMC.py @@ -13,6 +13,7 @@ from multiprocessing import Pool import scipy.stats as st from scipy.linalg import cholesky as chol import warnings +import time class MCMC(): """ diff --git a/BayesValidRox/surrogate_models/RegressionFastARD.py b/BayesValidRox/surrogate_models/RegressionFastARD.py index b6d8403d54ee9c50f8bbfb6351e649dc0a44f744..162f1fa69944ee356553f73c7737fd3774a5e489 100755 --- a/BayesValidRox/surrogate_models/RegressionFastARD.py +++ b/BayesValidRox/surrogate_models/RegressionFastARD.py @@ -150,8 +150,8 @@ class RegressionFastARD(): ''' - def __init__( self, n_iter = 300, start=None, tol = 1e-3, fit_intercept = True, - copy_X = True, compute_score=False, verbose = False): + def __init__( self, n_iter=300, start=None, tol=1e-3, fit_intercept=True, + copy_X=True, compute_score=False, verbose=False): self.n_iter = n_iter self.start = start self.tol = tol @@ -238,7 +238,7 @@ class RegressionFastARD(): start = np.argmax(proj) active[start] = True A[start] = XXd[start]/( proj[start] - var_y) - + warning_flag = 0 scores_ = [] for i in range(self.n_iter): @@ -277,7 +277,8 @@ class RegressionFastARD(): if self.verbose: print(('Iteration: {0}, number of features ' - 'in the model: {1}').format(i,np.sum(active))) + 'in the model: {1}').format(i,np.sum(active))) + if converged or i == self.n_iter - 1: if converged and self.verbose: print('Algorithm converged !') diff --git a/BayesValidRox/surrogate_models/surrogate_models.py b/BayesValidRox/surrogate_models/surrogate_models.py index 7334412fa873f59a42ff05103fbfc7129e139066..9342cb0fcd2484ed2e5c69b2d9fdd2268d997788 100644 --- a/BayesValidRox/surrogate_models/surrogate_models.py +++ b/BayesValidRox/surrogate_models/surrogate_models.py @@ -505,7 +505,7 @@ class aPCE: elif RegMethod == 'FastARD': clf_poly = RegressionFastARD(start=startBasisIndices,fit_intercept=False,compute_score=compute_score, - n_iter = 1000, tol= 1e-3) + n_iter=1500, tol=1e-3) elif RegMethod == 'LARS': clf_poly = linear_model.Lars(fit_intercept=False)