From ac48a58e4e13e8ffd115e4dced146f952a36e21a Mon Sep 17 00:00:00 2001 From: Richard Liaw Date: Thu, 20 Dec 2018 10:48:28 -0800 Subject: [PATCH] [tune] Reduce scope of variant generator (#3583) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR provides a better error message when the generate_variants code breaks. Also removes a comment about nesting dependencies. This comes mainly as a hotfix solution for #3466. We should leave that issue open for future contribution 🙂 --- python/ray/tune/suggest/variant_generator.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python/ray/tune/suggest/variant_generator.py b/python/ray/tune/suggest/variant_generator.py index b59ba2fe9..7e9ab95f9 100644 --- a/python/ray/tune/suggest/variant_generator.py +++ b/python/ray/tune/suggest/variant_generator.py @@ -33,10 +33,6 @@ def generate_variants(unresolved_spec): "cpu": lambda spec: spec.config.num_workers "batch_size": lambda spec: random.uniform(1, 1000) - It is also possible to nest the two, e.g. have a lambda function - return a grid search or vice versa, as long as there are no cyclic - dependencies between unresolved values. - Finally, to support defining specs in plain JSON / YAML, grid search and lambda functions can also be defined alternatively as follows: @@ -150,7 +146,7 @@ def _generate_variants(spec): raise ValueError( "The variable `{}` could not be unambiguously " "resolved to a single value. Consider simplifying " - "your variable dependencies.".format(k)) + "your configuration.".format(k)) resolved_vars[k] = v yield resolved_vars, spec