From c68c69e610b11bce5fd0232420c6e157ba4b6447 Mon Sep 17 00:00:00 2001 From: linusbiostat <102326615+linusbiostat@users.noreply.github.com> Date: Wed, 12 Oct 2022 12:14:40 +0000 Subject: [PATCH 1/3] Make TrialTerminationReporter working Signed-off-by: linusbiostat <102326615+linusbiostat@users.noreply.github.com> --- doc/source/tune/api_docs/reporters.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/tune/api_docs/reporters.rst b/doc/source/tune/api_docs/reporters.rst index f63302bbf0cc..4a1cf94ba27c 100644 --- a/doc/source/tune/api_docs/reporters.rst +++ b/doc/source/tune/api_docs/reporters.rst @@ -52,9 +52,11 @@ Extending ``CLIReporter`` lets you control reporting frequency. For example: tuner = tune.Tuner(my_trainable, run_config=air.RunConfig(progress_reporter=ExperimentTerminationReporter())) results = tuner.fit() - + + from ray.tune.trial import Trial class TrialTerminationReporter(CLIReporter): def __init__(self): + super(TrialTerminationReporter, self).__init__() self.num_terminated = 0 def should_report(self, trials, done=False): From 147f5ebde4ad10e7459794ebe92ce3890bf3b799 Mon Sep 17 00:00:00 2001 From: linusbiostat <102326615+linusbiostat@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:26:25 +0000 Subject: [PATCH 2/3] Update reporters.rst Signed-off-by: linusbiostat <102326615+linusbiostat@users.noreply.github.com> --- doc/source/tune/api_docs/reporters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tune/api_docs/reporters.rst b/doc/source/tune/api_docs/reporters.rst index 4a1cf94ba27c..5b430695562d 100644 --- a/doc/source/tune/api_docs/reporters.rst +++ b/doc/source/tune/api_docs/reporters.rst @@ -53,7 +53,7 @@ Extending ``CLIReporter`` lets you control reporting frequency. For example: tuner = tune.Tuner(my_trainable, run_config=air.RunConfig(progress_reporter=ExperimentTerminationReporter())) results = tuner.fit() - from ray.tune.trial import Trial + from ray.tune.experiment.trial import Trial class TrialTerminationReporter(CLIReporter): def __init__(self): super(TrialTerminationReporter, self).__init__() From 5f0b726917f9c2c97b9d9f6a5834d5c055819096 Mon Sep 17 00:00:00 2001 From: Antoni Baum Date: Thu, 13 Oct 2022 19:08:18 +0000 Subject: [PATCH 3/3] Nit Signed-off-by: Antoni Baum --- doc/source/tune/api_docs/reporters.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/source/tune/api_docs/reporters.rst b/doc/source/tune/api_docs/reporters.rst index 5b430695562d..6f0b90e0c3ca 100644 --- a/doc/source/tune/api_docs/reporters.rst +++ b/doc/source/tune/api_docs/reporters.rst @@ -45,6 +45,8 @@ Extending ``CLIReporter`` lets you control reporting frequency. For example: .. code-block:: python + from ray.tune.experiment.trial import Trial + class ExperimentTerminationReporter(CLIReporter): def should_report(self, trials, done=False): """Reports only on experiment termination.""" @@ -52,8 +54,7 @@ Extending ``CLIReporter`` lets you control reporting frequency. For example: tuner = tune.Tuner(my_trainable, run_config=air.RunConfig(progress_reporter=ExperimentTerminationReporter())) results = tuner.fit() - - from ray.tune.experiment.trial import Trial + class TrialTerminationReporter(CLIReporter): def __init__(self): super(TrialTerminationReporter, self).__init__()