def run_es(self, iterations=20): cs = self.__class__.get_configspace() lower, upper = get_upper_lower(cs) if not os.path.exists(self.run_dir): os.mkdir(self.run_dir) log_dir = os.path.join(self.run_dir, f'EXP{self.experiment_no}') if not os.path.exists(log_dir): os.mkdir(log_dir) results = entropy_search(self.compute, lower, upper, num_iterations=iterations, cs=cs, min_budget=self.min_budget, max_budget=self.max_budget) save_results_optimisation(results, log_dir) x_best = results["x_opt"] self.experiment_no += 1 print(x_best)
def run_bohamiann(self, iterations=20): cs = self.__class__.get_configspace() lower, upper = get_upper_lower(cs) results = bohamiann(self.compute, lower, upper, num_iterations=iterations, cs=cs) if not os.path.exists(self.run_dir): os.mkdir(self.run_dir) log_dir = os.path.join(self.run_dir, f'EXP{self.experiment_no}') if not os.path.exists(log_dir): os.mkdir(log_dir) save_results_optimisation(results, log_dir) x_best = results["x_opt"] self.experiment_no += 1 print('Best run', x_best) return x_best