diff --git a/.gitignore b/.gitignore index 054192681c12b446fb97e9771531bc944042f03c..acb906e2023293020272c9329370d5d02129c7ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -<<<<<<< HEAD tests/BeamTest/Polynomials/ tests/BeamTest/surrogateBeam/*.zip tests/BraninTest/Polynomials/*.npy @@ -57,8 +56,6 @@ tests/MECBM/SurrogateModel/SeqDesign_25_100_DPP/ tests/MECBM/SurrogateModel/SeqDesign_25_150_DKL/ tests/MECBM/SurrogateModel/__pycache__/read_MECBM.cpython-37.pyc tests/MECBM/model_exe_orig.sh - -======= BayesValidRox/BayesInference/__pycache__/Discrepancy.cpython-36.pyc BayesValidRox/surrogate_models/__pycache__/Exploration.cpython-36.pyc BayesValidRox/tests/AnalyticalFunction/AnalyticFunc_Results.pkl @@ -68,4 +65,3 @@ BayesValidRox/tests/AnalyticalFunction/Outputs_sequential_BayesOptDesign/ BayesValidRox/tests/AnalyticalFunction/Outputs_sequential_alphabetic/ BayesValidRox/tests/AnalyticalFunction/Polynomials/ BayesValidRox/tests/AnalyticalFunction/__pycache__/ ->>>>>>> 207fb20aecf53192b315efc4ccb75f6c0452b409 diff --git a/BayesValidRox/surrogate_models/Exploration.py b/BayesValidRox/surrogate_models/Exploration.py index 1ac8277dde9ec501cb91be8e45613f973d8eddef..5c686a73649661be3a536499d90f56d38a7ad319 100644 --- a/BayesValidRox/surrogate_models/Exploration.py +++ b/BayesValidRox/surrogate_models/Exploration.py @@ -26,7 +26,7 @@ class Exploration: self.OldExpDesign = PCEModel.ExpDesign.X self.Bounds = PCEModel.BoundTuples self.numNewSamples = NCandidate - self.mcCriterion = 'mc-intersite-proj' #'mc-intersite-proj-th' + self.mcCriterion = 'mc-intersite-proj-th' #'mc-intersite-proj-th' self.allCandidates = [] self.newSamples = [] @@ -78,14 +78,12 @@ class Exploration: # get amount of samples sortederrorVoronoi = np.sort(copy.copy(errorVoronoi))[::-1] - indices = np.argsort(errorVoronoi)[::-1] - bestSamples = indices #[:min(len(indices), numNewSamples)] + bestSamples = np.argsort(errorVoronoi)[::-1] # for each best sample, pick the best candidate point in the voronoi cell selectedSamples = np.empty((0, ndim)) - priorities = np.empty((0, 1)) - + badSamples = [] for i, index in enumerate(bestSamples): @@ -98,8 +96,8 @@ class Exploration: # still no candidate samples around this one, skip it! if nNewSamples == 0: - print('Sample %s with error %d skipped because there were no candidate samples around it...'%(OldExpDesign[index], sortederrorVoronoi[index])) - sortederrorVoronoi = np.delete(sortederrorVoronoi, [index], axis=0) + print('Sample %s skipped because there were no candidate samples around it...'%OldExpDesign[index]) + badSamples.append(index) continue # find candidate that is farthest away from any existing sample @@ -147,14 +145,10 @@ class Exploration: bestCandidate = np.argsort(totalDistScores)[::-1][:numNewSamples] selectedSamples = np.vstack((selectedSamples, candidates[bestCandidate])) - # add the priority to the list - priorities = np.vstack((priorities, sortederrorVoronoi[index])) - #print('Best candidate around sample %s was chosen to be %s, with minDistance %s'%(OldExpDesign[index], candidates[bestCandidate], totalDistScores[bestCandidate])) self.newSamples = selectedSamples #candidates - self.explorationScore = sortederrorVoronoi #np.sort(errorVoronoi)[::-1] - self.priorities = priorities + self.explorationScore = np.delete(sortederrorVoronoi, badSamples, axis=0) return self.newSamples, self.explorationScore