syne_tune.backend.simulator_backend.simulator_callback module
- class syne_tune.backend.simulator_backend.simulator_callback.SimulatorCallback(extra_results_composer=None)[source]
Bases:
StoreResultsCallback
Callback to be used in
run()
in order to support theSimulatorBackend
.This is doing two things. First,
on_tuning_sleep()
is advancing thetime_keeper
of the simulator backend bytuner_sleep_time
(also defined in the backend). The real sleep time inTuner
must be 0.Second, we need to make sure that results written out are annotated by simulated time, not real time. This is already catered for by
SimulatorBackend
addingST_TUNER_TIME
entries to each result it receives.Third (and most subtle), we need to make sure the stop criterion in
run()
is using simulated time instead of real time when making a decision based onmax_wallclock_time
. By default,StoppingCriterion
takesTuningStatus
as an input, which counts real time and knows nothing about simulated time. To this end, we modifystop_criterion
of the tuner to instead depend on theST_TUNER_TIME
fields in the results received. This allows us to keep bothTuner
andTuningStatus
independent of the time keeper.- Parameters:
extra_results_composer (
Optional
[ExtraResultsComposer
]) – Optional. If given, this is called inon_trial_result()
, and the resulting dictionary is appended as extra columns to the results dataframe