syne_tune.tuner_callback module

class syne_tune.tuner_callback.TunerCallback[source]

Bases: object

Allows user of Tuner to monitor progress, store additional results, etc.

on_tuning_start(tuner)[source]

Called at start of tuning loop

Parameters:

tunerTuner object

on_tuning_end()[source]

Called once the tuning loop terminates

This is called before Tuner object is serialized (optionally), and also before running jobs are stopped.

on_loop_start()[source]

Called at start of each tuning loop iteration

Every iteration starts with fetching new results from the backend. This is called before this is done.

on_loop_end()[source]

Called at end of each tuning loop iteration

This is done before the loop stopping condition is checked and acted upon.

on_fetch_status_results(trial_status_dict, new_results)[source]

Called just after trial_backend.fetch_status_results

Parameters:
  • trial_status_dict (Dict[int, Tuple[Trial, str]]) – Result of fetch_status_results

  • new_results (List[Tuple[int, dict]]) – Result of fetch_status_results

on_trial_complete(trial, result)[source]

Called when a trial completes (Status.completed)

The arguments here also have been passed to scheduler.on_trial_complete, before this call here.

Parameters:
  • trial (Trial) – Trial that just completed.

  • result (Dict[str, Any]) – Last result obtained.

on_trial_result(trial, status, result, decision)[source]

Called when a new result (reported by a trial) is observed

The arguments here are inputs or outputs of scheduler.on_trial_result (called just before).

Parameters:
  • trial (Trial) – Trial whose report has been received

  • status (str) – Status of trial before scheduler.on_trial_result has been called

  • result (Dict[str, Any]) – Result dict received

  • decision (str) – Decision returned by scheduler.on_trial_result

on_tuning_sleep(sleep_time)[source]

Called just after tuner has slept, because no worker was available

Parameters:

sleep_time (float) – Time (in secs) for which tuner has just slept

on_start_trial(trial)[source]

Called just after a new trials is started

Parameters:

trial (Trial) – Trial which has just been started

on_resume_trial(trial)[source]

Called just after a trial is resumed

Parameters:

trial (Trial) – Trial which has just been resumed