AxMultitaskGenerator#
- class optimas.generators.AxMultitaskGenerator(varying_parameters, objectives, lofi_task, hifi_task, analyzed_parameters=None, use_cuda=False, gpu_id=0, dedicated_resources=False, save_model=True, model_save_period=5, model_history_dir='model_history')#
Multitask Bayesian optimization using the Ax developer API.
Two tasks need to be provided: one for low-fidelity evaluations and another for high-fidelity evaluations. The objective will be optimized by maximizing (or minimizing) its high-fidelity value. Only one objective can be provided.
- Parameters:
- varying_parameterslist of VaryingParameter
List of input parameters to vary. One them should be a fidelity.
- objectiveslist of Objective
List of optimization objectives. Only one objective is supported.
- lofi_task, hifi_taskTask
The low- and high-fidelity tasks.
- analyzed_parameterslist of Parameter, optional
List of parameters to analyze at each trial, but which are not optimization objectives. By default
None.- use_cudabool, optional
Whether to allow the generator to run on a CUDA GPU. By default
False.- gpu_idint, optional
The ID of the GPU in which to run the generator. By default,
0.- dedicated_resourcesbool, optional
Whether to allocated dedicated resources (e.g., the GPU) for the generator. These resources will not be available to the simulation workers. By default,
False.- save_modelbool, optional
Whether to save the optimization model (in this case, the Ax experiment) to disk. By default
True.- model_save_periodint, optional
Periodicity, in number of evaluated Trials, with which to save the model to disk. By default,
5.- model_history_dirstr, optional
Name of the directory in which the model will be saved. By default,
'model_history'.
Methods
ask_trials(n_trials)Ask the generator to suggest the next
n_trialsto evaluate.attach_trials(trial_data[, ...])Manually add a list of trials to the generator.
get_gen_specs(sim_workers, run_params, sim_max)Get the libEnsemble gen_specs.
Get the libEnsemble libe_specs.
get_trial(trial_index)Get trial by index.
ignore_trials(trials)Ignore trials as determined by the generator.
incorporate_history(history)Incorporate past history into the generator.
ingest(results)Incorporate evaluated trials into experiment.
mark_trial_as_failed(trial_index)Mark an already evaluated trial as failed.
Save model to file.
suggest(num_points)Request the next set of points to evaluate.
tell_trials(trials[, allow_saving_model])Give trials back to generator once they have been evaluated.
update_parameter(parameter)Update a varying parameter of the generator.
Attributes
Get the list of analyzed parameters.
Get the list of constraints.
Get whether the generator has dedicated resources allocated.
Get the ID of the GPU used by the generator.
Get the number of successfully evaluated trials.
Get the number of evaluated trials.
Get the number of unsuccessfully evaluated trials.
Get the number of trials given for evaluation.
Get the number of trials queued for evaluation.
Get the list of objectives.
Get whether the generator can use CUDA.
Get the list of varying parameters.