コード例 #1
0
ファイル: main.py プロジェクト: shalijiang/Cornell-MOE
argv = sys.argv[1:]
obj_func_name = str(argv[0])
method = str(argv[1])
num_to_sample = int(argv[2])
job_id = int(argv[3])

# constants
num_func_eval = 100
num_iteration = int(num_func_eval / num_to_sample) + 1

obj_func_dict = {
    'Branin': synthetic_functions.Branin(),
    'Rosenbrock': synthetic_functions.Rosenbrock(),
    'Hartmann3': synthetic_functions.Hartmann3(),
    'Levy4': synthetic_functions.Levy4(),
    'Hartmann6': synthetic_functions.Hartmann6()
}
#'CIFAR10': real_functions.CIFAR10(),
#'KISSGP': real_functions.KISSGP()}

objective_func = obj_func_dict[obj_func_name]
dim = int(objective_func._dim)
num_initial_points = int(objective_func._num_init_pts)

num_fidelity = objective_func._num_fidelity

inner_search_domain = pythonTensorProductDomain([
    ClosedInterval(objective_func._search_domain[i, 0],
                   objective_func._search_domain[i, 1])
    for i in xrange(objective_func._search_domain.shape[0] - num_fidelity)
])
コード例 #2
0
ファイル: main.py プロジェクト: freephys/Cornell-MOE
# python main.py [obj_func_name] [method_name] [num_to_sample] [job_id]
# example: python main.py Branin KG 4 1000 1
# you can define your own obj_function and then just change the objective_func object below, and run this script.

argv = sys.argv[1:]
obj_func_name = str(argv[0])
method = str(argv[1])
num_to_sample = int(argv[2])
job_id = int(argv[3])

# constants
num_func_eval = 60
num_iteration = int(num_func_eval / num_to_sample) + 1

obj_func_dict = {'Branin': synthetic_functions.Branin(), 'Rosenbrock': synthetic_functions.Rosenbrock(),
                 'Hartmann3': synthetic_functions.Hartmann3(), 'Hartmann6': synthetic_functions.Hartmann6()}
                 #'CIFAR10': real_functions.CIFAR10(),
                 #'KISSGP': real_functions.KISSGP()}

objective_func = obj_func_dict[obj_func_name]
dim = int(objective_func._dim)
num_initial_points = int(objective_func._num_init_pts)

num_fidelity = objective_func._num_fidelity

inner_search_domain = pythonTensorProductDomain([ClosedInterval(objective_func._search_domain[i, 0], objective_func._search_domain[i, 1])
                                                 for i in xrange(objective_func._search_domain.shape[0]-num_fidelity)])
cpp_search_domain = cppTensorProductDomain([ClosedInterval(bound[0], bound[1]) for bound in objective_func._search_domain])
cpp_inner_search_domain = cppTensorProductDomain([ClosedInterval(objective_func._search_domain[i, 0], objective_func._search_domain[i, 1])
                                                  for i in xrange(objective_func._search_domain.shape[0]-num_fidelity)])