gpCAM¶
- class gen_classes.gpCAM.GP_CAM(vocs, ask_max_iter=10, random_seed=1, *args, **kwargs)¶
Bases:
LibensembleGeneratorThis generation function constructs a global surrogate of f values.
It is a batched method that produces a first batch uniformly random from (lb, ub). On subsequent iterations, it calls an optimization method to produce the next batch of points. This optimization might be too slow (relative to the simulation evaluation time) for some use cases.
- Parameters:
vocs (VOCS)
ask_max_iter (int)
random_seed (int)
- suggest(num_points=0)¶
Request the next set of points to evaluate.
- Parameters:
num_points (int | None)
- Return type:
List[dict]
- ingest(results)¶
Send the results of evaluations to the generator.
- Parameters:
results (List[dict])
- Return type:
None
- class gen_classes.gpCAM.GP_CAM_Covar(vocs, test_points_file=None, use_grid=False, *args, **kwargs)¶
Bases:
GP_CAMThis generation function constructs a global surrogate of f values.
It is a batched method that produces a first batch uniformly random from (lb, ub) and on following iterations samples the GP posterior covariance function to find sample points.
- Parameters:
vocs (VOCS)
test_points_file (str)
use_grid (bool)
- suggest(num_points=0)¶
Request the next set of points to evaluate.
- Parameters:
num_points (int | None)
- Return type:
List[dict]
- ingest(results)¶
Send the results of evaluations to the generator.
- Parameters:
results (List[dict])
- Return type:
None
See also
1 vocs = VOCS(variables={"x0": [-3, 3], "x1": [-2, 2], "x2": [-1, 1], "x3": [-1, 1]}, objectives={"f": "MINIMIZE"})
2
3 gen = GP_CAM_Covar(vocs)
4
5 for inst in range(3):
6 if inst == 0:
7 gen_specs["generator"] = gen
8 num_batches = 10
9 exit_criteria = {"sim_max": num_batches * batch_size, "wallclock_max": 300}
10 libE_specs["save_every_k_gens"] = 150
11 libE_specs["H_file_prefix"] = "gpCAM_nongrid"
12 if inst == 1:
13 gen = GP_CAM_Covar(vocs, use_grid=True, test_points_file="gpCAM_nongrid_after_gen_150.npy")
14 gen_specs["generator"] = gen
15 libE_specs["final_gen_send"] = True
16 del libE_specs["H_file_prefix"]
17 del libE_specs["save_every_k_gens"]
18 elif inst == 2:
19 gen = GP_CAM(vocs, ask_max_iter=1)
20 gen_specs["generator"] = gen
21 num_batches = 3 # Few because the ask_tell gen can be slow
22 exit_criteria = {"sim_max": num_batches * batch_size, "wallclock_max": 300}
23
24 # Perform the run
25 H, persis_info, flag = libE(sim_specs, gen_specs, exit_criteria, {}, libE_specs=libE_specs)