syne_tune.optimizer.schedulers.fifo module
- class syne_tune.optimizer.schedulers.fifo.FIFOScheduler(config_space, **kwargs)[source]
Bases:
TrialSchedulerWithSearcher
Scheduler which executes trials in submission order.
This is the most basic scheduler template. It can be configured to many use cases by choosing
searcher
along withsearch_options
.- Parameters:
config_space (Dict[str, Any]) – Configuration space for evaluation function
searcher (str or
BaseSearcher
) – Searcher forget_config
decisions. String values are passed tosearcher_factory()
along withsearch_options
and extra information. Supported values:SUPPORTED_SEARCHERS_FIFO
. Defaults to “random” (i.e., random search)search_options (Dict[str, Any], optional) – If searcher is
str
, these arguments are passed tosearcher_factory()
metric (str or List[str]) – Name of metric to optimize, key in results obtained via
on_trial_result
. For multi-objective schedulers, this can also be a listmode (str or List[str], optional) – “min” if
metric
is minimized, “max” ifmetric
is maximized, defaults to “min”. This can also be a list ifmetric
is a listpoints_to_evaluate (
List[dict]
, optional) – List of configurations to be evaluated initially (in that order). Each config in the list can be partially specified, or even be an empty dict. For each hyperparameter not specified, the default value is determined using a midpoint heuristic. If not given, this is mapped to[dict()]
, a single default config determined by the midpoint heuristic. If[]
(empty list), no initial configurations are specified. Note: Ifsearcher
is of typeBaseSearcher
,points_to_evaluate
must be set there.random_seed (int, optional) – Master random seed. Generators used in the scheduler or searcher are seeded using
RandomSeedGenerator
. If not given, the master random seed is drawn at random here.max_resource_attr (str, optional) – Key name in config for fixed attribute containing the maximum resource. If this is given,
max_t
is not needed. We recommend to usemax_resource_attr
overmax_t
. If given, we use it to infermax_resource_level
. It is also used to limit trial executions in promotion-based multi-fidelity schedulers (see class:HyperbandScheduler
,type="promotion"
).max_t (int, optional) – Value for
max_resource_level
. Needed for schedulers which make use of intermediate reports viaon_trial_result
. If this is not given, we try to infer its value fromconfig_space
(seeResourceLevelsScheduler
). checkingconfig_space["epochs"]
,config_space["max_t"]
, andconfig_space["max_epochs"]
. Ifmax_resource_attr
is given, we use the valueconfig_space[max_resource_attr]
. But ifmax_t
is given here, it takes precedence.time_keeper (
TimeKeeper
, optional) – This will be used for timing here (see_elapsed_time
). The time keeper has to be started at the beginning of the experiment. If not given, we use a local time keeper here, which is started with the first call to_suggest()
. Can also be set after construction, withset_time_keeper()
. Note: If you useSimulatorBackend
, you need to pass itstime_keeper
here.
- property searcher: BaseSearcher | None
- set_time_keeper(time_keeper)[source]
Assign time keeper after construction.
This is possible only if the time keeper was not assigned at construction, and the experiment has not yet started.
- Parameters:
time_keeper (
TimeKeeper
) – Time keeper to be used
- on_trial_result(trial, result)[source]
We simply relay
result
to the searcher. Other decisions are done inon_trial_complete
.- Return type:
str
- metric_names()[source]
- Return type:
List
[str
]- Returns:
List of metric names. The first one is the target metric optimized over, unless the scheduler is a genuine multi-objective metric (for example, for sampling the Pareto front)