AxSingleFidelityGenerator#

class optimas.generators.AxSingleFidelityGenerator(vocs, parameter_constraints=None, n_init=4, enforce_n_init=False, abandon_failed_trials=True, fit_out_of_design=False, fully_bayesian=False, use_cuda=False, gpu_id=0, dedicated_resources=False, save_model=True, model_save_period=5, model_history_dir='model_history')#

Single-fidelity Bayesian optimization using the Ax service API.

Depending on whether a single or multiple objectives are given, the acquisition function will be qNEI (Noisy Expected Improvement) or qNEHVI (Noisy Expected Hypervolume Improvement).

By default, the hyperparameters of the GP are optimized by maximizing the maximal likelihood of the data. A fully Bayesian approach using SAAS priors is also available, which has been shown to perform well for high-dimensional optimization [1] [2].

Parameters:
vocsVOCS

VOCS object defining variables, objectives, constraints, and observables.

parameter_constraintslist of str, optional

List of string representation of parameter constraints, such as "x3 >= x4" or "-x3 + 2*x4 - 3.5*x5 >= 2". For the latter constraints, any number of arguments is accepted, and acceptable operators are <= and >=.

outcome_constraintslist of str, optional

List of string representation of outcome constraints (i.e., constraints on any of the analyzed_parameters) of form "metric_name >= bound", like "m1 <= 3.".

n_initint, optional

Number of evaluations to perform during the initialization phase using Sobol sampling. If external data is attached to the exploration, the number of initialization evaluations will be reduced by the same amount, unless enforce_n_init=True. By default, 4.

enforce_n_initbool, optional

Whether to enforce the generation of n_init Sobol trials, even if external data is supplied. By default, False.

abandon_failed_trialsbool, optional

Whether failed trials should be abandoned (i.e., not suggested again). By default, True.

fit_out_of_designbool, optional

Whether to fit the surrogate model taking into account evaluations outside of the range of the varying parameters. This can be useful if the range of parameter has been reduced during the optimization. By default, False.

fully_bayesianbool, optional

Whether to optimize the hyperparameters of the GP with a fully Bayesian approach (using SAAS priors) instead of maximizing marginal likelihood. The fully Bayesian treatment is more expensive (i.e., it takes longer to generate new trials) but can lead to improved BO performance (i.e., requiring less evaluations). This approach is specially well suited for high-dimensional optimization. By default False.

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 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'.

References

[1]

D. Eriksson, M. Jankowiak. High-Dimensional Bayesian Optimization with Sparse Axis-Aligned Subspaces. Proceedings of the Thirty-Seventh Conference on Uncertainty in Artificial Intelligence, 2021.

Methods

ask_trials(n_trials)

Ask the generator to suggest the next n_trials to 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_libe_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()

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

analyzed_parameters

Get the list of analyzed parameters.

ax_client

Get the underlying AxClient.

constraints

Get the list of constraints.

dedicated_resources

Get whether the generator has dedicated resources allocated.

gpu_id

Get the ID of the GPU used by the generator.

model

Get access to the underlying model using an AxModelManager.

n_completed_trials

Get the number of successfully evaluated trials.

n_evaluated_trials

Get the number of evaluated trials.

n_failed_trials

Get the number of unsuccessfully evaluated trials.

n_given_trials

Get the number of trials given for evaluation.

n_queued_trials

Get the number of trials queued for evaluation.

objectives

Get the list of objectives.

returns_id

Indicates whether this generator returns IDs with the suggested points.

use_cuda

Get whether the generator can use CUDA.

varying_parameters

Get the list of varying parameters.

vocs

Get the VOCS object.