mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
[tune] Reset Config for Trainables (#2831)
Adds the ability for trainables to reset their configurations during experiments. These changes in particular add the base functions to the trial_executor and trainable interfaces as well as giving the basic implementation on the PopulationBasedTraining scheduler. Related issue number: #2741
This commit is contained in:
@@ -106,6 +106,21 @@ class TrialExecutor(object):
|
||||
assert trial.status == Trial.PAUSED, trial.status
|
||||
self.start_trial(trial)
|
||||
|
||||
def reset_trial(self, trial, new_config, new_experiment_tag):
|
||||
"""Tries to invoke `Trainable.reset_config()` to reset trial.
|
||||
|
||||
Args:
|
||||
trial (Trial): Trial to be reset.
|
||||
new_config (dict): New configuration for Trial
|
||||
trainable.
|
||||
new_experiment_tag (str): New experiment name
|
||||
for trial.
|
||||
|
||||
Returns:
|
||||
True if `reset_config` is successful else False.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def get_running_trials(self):
|
||||
"""Returns all running trials."""
|
||||
raise NotImplementedError("Subclasses of TrialExecutor must provide "
|
||||
|
||||
Reference in New Issue
Block a user