def compile_hartmann6()

in benchmarks/compile_benchmark_results.py [0:0]


def compile_hartmann6(D, random_subspace=False):
    if D == 100:
        problem = hartmann6_100
        other_methods = ['addgpucb', 'cmaes', 'ebo', 'smac', 'turbo']
        rls = ['rrembos_standard_kPsi', 'rrembos_reverse_kPsi', 'coordinatelinebo', 'descentlinebo', 'randomlinebo']
        rs_str = ''
    elif D == 1000 and not random_subspace:
        problem = hartmann6_1000
        other_methods = ['cmaes', 'smac', 'turbo']
        rls = ['rrembos_standard_kPsi']
        rs_str = ''
    elif D == 1000 and random_subspace:
        problem = hartmann6_random_subspace_1000
        other_methods = ['cmaes', 'smac', 'turbo']
        rls = []
        rs_str = 'random_subspace_'

    all_results = {}

    for rep in range(50):
        with open(f'results/hartmann6_{rs_str}{D}_alebo_rembo_hesbo_sobol_rep_{rep}.json', 'r') as fin:
            res_i = object_from_json(json.load(fin))

        all_results = merge_benchmark_results(all_results, res_i)

        for method_name in other_methods:
            if D==1000 and method_name == 'smac' and rep > 9:
                # SMAC D=1000 only run for 10 reps
                continue

            with open(f'results/hartmann6_{rs_str}{D}_{method_name}_rep_{rep}.json', 'r') as fin:
                exp_i = object_from_json(json.load(fin))

            all_results = add_exp(res=all_results, exp=exp_i, problem_name=problem.name, method_name=method_name)

    res = aggregate_problem_results(runs=all_results[problem.name], problem=problem)

    # Add in RRembo and LineBOresults
    for method in rls:
        with open(f'results/hartmann6_{D}_{method}.json', 'r') as fin:
            A = json.load(fin)
        res.objective_at_true_best[method] = np.minimum.accumulate(np.array(A), axis=1)

    # Save
    with open(f'results/hartmann6_{rs_str}{D}_aggregated_results.json', "w") as fout:
        json.dump(object_to_json({problem.name: res}), fout)