From 0dd8a60679e453c86d784dda1cceceb086e35358 Mon Sep 17 00:00:00 2001 From: inventormc Date: Thu, 26 Dec 2019 14:27:07 -0800 Subject: [PATCH] [tune] Usability errors PBT (#5972) * update with upstream master * check for function args in hyperparam_mutations pbt * fix style for pbt * remove_checkpoint * Update pbt.py * Update pbt.py * fix Co-authored-by: Richard Liaw --- python/ray/tune/schedulers/pbt.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/ray/tune/schedulers/pbt.py b/python/ray/tune/schedulers/pbt.py index 7d4046059..67aab6b33 100644 --- a/python/ray/tune/schedulers/pbt.py +++ b/python/ray/tune/schedulers/pbt.py @@ -183,6 +183,11 @@ class PopulationBasedTraining(FIFOScheduler): resample_probability=0.25, custom_explore_fn=None, log_config=True): + for value in hyperparam_mutations.values(): + if not (isinstance(value, list) or callable(value)): + raise TypeError("`hyperparam_mutation` values must be either " + "a List or callable.") + if not hyperparam_mutations and not custom_explore_fn: raise TuneError( "You must specify at least one of `hyperparam_mutations` or "