MultiObjectiveOptimizer¶

class MultiObjectiveOptimizer¶

Bases: object

Class for black-box optimization with multiple objective functions.

Methods

__init__

Initialize MultiObjectiveOptimizer.

fetch_history

Return the optimization history.

optimize

Perform black-box optmization with multiple objective functions.

Attributes

amplify_model

The current Amplify-SDK model.

best_objective

Objective function value corresponding to the current best solution (optimaized input).

best_solution

Current best solution (optimized input).

custom_amplify_objective

Custom objective function that may be ceated directly from amplify.PolyArray.

data

The current training data.

i_cycle

The number of current optimization cycle.

objectives

Objective functions considered in the MultiObjectiveOptimizer.

optimizers

Optimizers passed to the MultiObjectiveOptimizer.

__init__(
optimizers: list[QAOptimizerBase],
client: FixstarsClient | DWaveSamplerClient | LeapHybridSamplerClient | LeapHybridCQMSamplerClient | FujitsuDA4Client | ToshibaSQBM2Client | GurobiClient | NECVA2Client,
seed: int = 0,
) None¶

Initialize MultiObjectiveOptimizer.

Parameters:
  • optimizers (list[QAOptimizerBase]) – A list of optimizers each of which is associated with a black-box function, relevant decision variables and constraints. These optimizers do not have to be the same type, e.g. a list like [FMQAOptimizer, KernelQAOptimizer] is allowd. Generally, these individual optimizers are used for everything except the amplify.Model construction and communication with an external solver.

  • client (amplify.FixstarsClient | amplify.DWaveSamplerClient | amplify.LeapHybridSamplerClient | amplify.LeapHybridCQMSamplerClient | amplify.FujitsuDA4Client | amplify.ToshibaSQBM2Client | amplify.GurobiClient | amplify.NECVA2Client) – A solver client available in the Amplify SDK.

  • seed (int, optional) – A random seed. Defaults to 0.

fetch_history() History¶

Return the optimization history. In multiple-objective optimization, number of initial traininig samples contained in the history is always zero (as individual datasets do not always meet constraints and duplicate variables across objectives).

Returns:

The optimization history.

Return type:

History

optimize(
num_cycles: int = 10,
constraint_weight: float | None = None,
num_solves: int = 1,
search_max: int = 1000,
show_annealing_history: bool = False,
) None¶

Perform black-box optmization with multiple objective functions.

Parameters:
  • num_cycles (int, optional) – A number of optimization iterations. Defaults to 10.

  • constraint_weight (float | None, optional) – A weight for constraints. If set None, the weight is determined based on the latest training data as in 2 times of DataList.abs_y_max. If constraint weights are seperately set for Constraint.weight, this constraint_weight is multiplied on top of Constraint.weight. Defaults to None.

  • num_solves (int, optional) – A number of serial solver execution in the Amplify SDK’s serial solver execution (https://amplify.fixstars.com/en/docs/amplify/v1/serial.html). Defaults to 1.

  • search_max (int, optional) – If the found solution is found the training data, alternative solution close to the original solution is searched for at most search_max times. Defaults to 1000.

  • show_annealing_history (bool, optional) – True to show a annealing history with time stamp. Available when Amplify Annealing Engine (amplify.FixstarsClient) is specified as the client in the constructor. Defaults to False.

__dict__ = mappingproxy({'__module__': 'amplify_bbopt.optimizer', '__doc__': 'Class for black-box optimization with multiple objective functions.', '__init__': <function MultiObjectiveOptimizer.__init__>, 'custom_amplify_objective': <property object>, 'best_objective': <property object>, 'best_solution': <property object>, 'optimizers': <property object>, 'objectives': <property object>, 'optimize': <function MultiObjectiveOptimizer.optimize>, '_generate_surrogate_models': <function MultiObjectiveOptimizer._generate_surrogate_models>, '_generate_amplify_model': <function MultiObjectiveOptimizer._generate_amplify_model>, '_evaluate_objective_funcs': <function MultiObjectiveOptimizer._evaluate_objective_funcs>, '_evaluate_custom_objective': <function MultiObjectiveOptimizer._evaluate_custom_objective>, '_is_satisfied': <function MultiObjectiveOptimizer._is_satisfied>, '_generate_alternative_solution': <function MultiObjectiveOptimizer._generate_alternative_solution>, '_combine_solutions': <function MultiObjectiveOptimizer._combine_solutions>, '_divide_into_solutions': <function MultiObjectiveOptimizer._divide_into_solutions>, '_ensure_uniqueness': <function MultiObjectiveOptimizer._ensure_uniqueness>, '_anneal': <function MultiObjectiveOptimizer._anneal>, 'i_cycle': <property object>, 'data': <property object>, 'amplify_model': <property object>, 'fetch_history': <function MultiObjectiveOptimizer.fetch_history>, '__dict__': <attribute '__dict__' of 'MultiObjectiveOptimizer' objects>, '__weakref__': <attribute '__weakref__' of 'MultiObjectiveOptimizer' objects>, '__annotations__': {'_optimizers': 'list[QAOptimizerBase]', '_best_objective': 'int | float | None', '_amplify_model': 'amplify.Model | None', '_elapsed_time': 'list[float]', '_is_de_duplication': 'list[bool]'}})¶
__weakref__¶

list of weak references to the object (if defined)

property amplify_model: Model | None¶

The current Amplify-SDK model. If the model is not constructed yet, return None.

property best_objective: int | float | None¶

Objective function value corresponding to the current best solution (optimaized input).

Returns:

If no data exists, return None

Return type:

int | float | None

property best_solution: FlatSolutionDict | None¶

Current best solution (optimized input).

property custom_amplify_objective: Poly¶

Custom objective function that may be ceated directly from amplify.PolyArray.

Custom objective does NOT have to be converted from the surrogate model of the black-box function. Retieve amplify.PolyArray via Variables.poly_array or Variables.amplify_variables, and construct an Amplify SDK’s objective function directly, which will be added to the objective constructed from a surrogate model while creating amplify.Model. Such a custom objective function must be created after the instantiation of an QA-based optimizer class, as this is when amplify.PolyArray’s are issued for each of the variables.

property data: DataList¶

The current training data.

property i_cycle: int¶

The number of current optimization cycle.

property objectives: BlackBoxFuncList¶

Objective functions considered in the MultiObjectiveOptimizer.

property optimizers: list[QAOptimizerBase]¶

Optimizers passed to the MultiObjectiveOptimizer.