Configspace
smac.utils.configspace #
convert_configurations_to_array #
将配置中非活动的超参数用其默认值填充。
参数#
configs : List[Configuration] 配置对象列表。
返回值#
np.ndarray
源代码位于 smac/utils/configspace.py
get_conditional_hyperparameters #
如果观察到值小于等于-1,则返回条件超参数。如果未指定 Y,则使用 X。
源代码位于 smac/utils/configspace.py
get_config_hash #
get_types #
get_types(
configspace: ConfigurationSpace,
instance_features: dict[str, list[float]] | None = None,
) -> tuple[list[int], list[tuple[float, float]]]
返回超参数的类型、超参数的边界以及实例特征的边界。
警告#
实例特征的边界不在此函数中添加。
源代码位于 smac/utils/configspace.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
print_config_changes #
print_config_changes(
incumbent: Configuration | None,
challenger: Configuration | None,
logger: Logger,
) -> None
比较两个配置并打印差异。
源代码位于 smac/utils/configspace.py
transform_continuous_designs #
transform_continuous_designs(
design: ndarray,
origin: str,
configspace: ConfigurationSpace,
) -> list[Configuration]
将连续设计转换为离散的配置列表。
参数#
design : np.ndarray 源自初始设计策略的超参数数组。 origin : str | None,默认为 None 配置的来源标签。 configspace : ConfigurationSpace
返回值#
configs : list[Configuration] 连续转换后的配置列表。