AxClientGenerator#
- class optimas.generators.AxClientGenerator(ax_client, abandon_failed_trials=True, gpu_id=0, dedicated_resources=False, save_model=True, model_save_period=5, model_history_dir='model_history')#
Bayesian optimization generator with a user-defined
AxClient.This generator allows the user to provide a custom
AxClient, allowing for maximum control of the optimization.For this generator there is no need to provide the
vocs. The generator builds a VOCS (variables, objectives, constraints, and observables) directly from theAxClient.- Parameters:
- ax_clientAxClient
The Ax client from which the trials will be generated.
- abandon_failed_trialsbool, optional
Whether failed trials should be abandoned (i.e., not suggested again). By default,
True.- gpu_idint, optional
The ID of the GPU in which to run the generator. By default,
0. This parameter will only have an effect if anyGenerationStepin theAxClientuses a GPU.- 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. This parameter will only have an effect if anyGenerationStepin theAxClientuses a GPU.- save_modelbool, optional
Whether to save the optimization model (in this case, the Ax client) 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'.
Notes
Outcome constraints are passed into VOCS as constraints and are correctly used by the
AxClient. Theoptimaslog/display does not yet show constraints separately; constraint metrics may appear as extra columns.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.
finalize()Perform any work required to close down the generator.
fix_value(var_name, value)Fix a parameter to a specific value.
free_value(var_name)Free a previously fixed parameter.
get_gen_specs(sim_workers, run_params, max_evals)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)Send the results of evaluations to the generator.
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.
update_range(var_name, lower_bound, upper_bound)Update the range of a parameter.
Attributes
Get the list of analyzed parameters.
Get the underlying AxClient.
Get the list of constraints.
Get whether the generator has dedicated resources allocated.
Get the ID of the GPU used by the generator.
Get access to the underlying model using an AxModelManager.
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.
Indicates whether this generator returns IDs with the suggested points.
Get whether the generator can use CUDA.
Get the list of varying parameters.
Get the VOCS object.