I am trying to write a custom scheduler that pauses trials at some point and then continues them at a later time. Currently the scheduler reruns the paused trials from the beginning, how can I implement this behaviour? In the example of the Trial_Scheduler class there is no example on how to use the save/restore functions.
Abstracting the TrialScheduler class, my code looks like this:
def choose_trial_to_run(self, tune_controller: "TuneController") -> Optional[Trial]:
for trial in tune_controller.get_trials():
if trial.status == Trial.PAUSED and condition == True:
# restore and return trial
def on_trial_result(self, tune_controller: "TuneController", trial: Trial, result: Dict) -> str:
if some_other_condition == True:
# save trial
return TrialScheduler.PAUSE