跳到内容

聚合策略

smac.multi_objective.aggregation_strategy #

MeanAggregationStrategy #

MeanAggregationStrategy(
    scenario: Scenario,
    objective_weights: list[float] | None = None,
)

基类: 抽象多目标算法

将多目标成本平均聚合成单一成本的类。

参数#

scenario : Scenario objective_weights : list[float] | None,默认为 None 加权平均的权重。必须与目标数量相同。

源代码位于 smac/multi_objective/aggregation_strategy.py
def __init__(
    self,
    scenario: Scenario,
    objective_weights: list[float] | None = None,
):
    super(MeanAggregationStrategy, self).__init__()

    if objective_weights is not None and scenario.count_objectives() != len(objective_weights):
        raise ValueError("Number of objectives and number of weights must be equal.")

    self._objective_weights = objective_weights

meta property #

meta: dict[str, Any]

返回创建对象的元数据。

update_on_iteration_start #

update_on_iteration_start() -> None

在每次 SMBO 迭代开始时更新内部状态。

源代码位于 smac/multi_objective/abstract_multi_objective_algorithm.py
def update_on_iteration_start(self) -> None:
    """Update the internal state on start of each SMBO iteration."""
    pass