Config selector
smac.main.config_selector
#
ConfigSelector
#
ConfigSelector(
scenario: Scenario,
*,
retrain_after: int = 8,
max_new_config_tries: int = 16,
min_trials: int = 1
)
The config selector handles the surrogate model and the acquisition function. Based on both components, the next configuration is selected.
| PARAMETER | DESCRIPTION |
|---|---|
retrain_after
|
How many configurations should be returned before the surrogate model is retrained.
TYPE:
|
max_new_config_tries
|
How often to retry receiving a new configuration before giving up.
TYPE:
|
min_trials
|
How many samples are required to train the surrogate model. If budgets are involved, the highest budgets are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for the highest budget, we will use trials of a lower budget instead.
TYPE:
|
Source code in smac/main/config_selector.py
__iter__
#
__iter__() -> Iterator[Configuration]
This method returns the next configuration to evaluate. It ignores already processed configurations, i.e.,
the configurations from the runhistory, if the runhistory is not empty.
The method (after yielding the initial design configurations) trains the surrogate model, maximizes the
acquisition function and yields n configurations. After the n configurations, the surrogate model is
trained again, etc. The program stops if retries was reached within each iteration. A configuration
is ignored, if it was used already before.
Note
When SMAC continues a run, processed configurations from the runhistory are ignored. For example, if the intitial design configurations already have been processed, they are ignored here. After the run is continued, however, the surrogate model is trained based on the runhistory in all cases.
| RETURNS | DESCRIPTION |
|---|---|
next_config
|
The next configuration to evaluate.
TYPE:
|
Source code in smac/main/config_selector.py
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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |