syne_tune.backend.simulator_backend.simulator_callback module
- class syne_tune.backend.simulator_backend.simulator_callback.SimulatorCallback(extra_results_composer=None)[source]
Bases:
StoreResultsCallbackCallback to be used in
run()in order to support theSimulatorBackend.This is doing two things. First,
on_tuning_sleep()is advancing thetime_keeperof the simulator backend bytuner_sleep_time(also defined in the backend). The real sleep time inTunermust 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
SimulatorBackendaddingST_TUNER_TIMEentries 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,StoppingCriteriontakesTuningStatusas an input, which counts real time and knows nothing about simulated time. To this end, we modifystop_criterionof the tuner to instead depend on theST_TUNER_TIMEfields in the results received. This allows us to keep bothTunerandTuningStatusindependent 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