From 094125cf0343dea4aa6fd6ce218b30ebbdf7236f Mon Sep 17 00:00:00 2001 From: Anthony Yu <13611707+anthonyhsyu@users.noreply.github.com> Date: Fri, 13 Mar 2020 15:27:03 -0700 Subject: [PATCH] [tune] Dragonfly integration ask tell nit (#7593) * Add sample example * Copy relevant lines of ask from inherited Optimizer * Ignore strategy * Additional changes * Add DragonflySearch for tune connector for Dragonfly * Add example and fix small errors * lint * Remove skopt references * Update example based off of Dragonfly changes * Edit example for final Dragonfly edits * Formatting and documentation edits * Add documentation and add to test pipeline * Address PR comments * Fix Jenkins test * Adjust Dragonfly to PR#7366 * Lint * fix_tests * Minor changes to ordering Co-authored-by: Richard Liaw --- python/ray/tune/suggest/dragonfly.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/ray/tune/suggest/dragonfly.py b/python/ray/tune/suggest/dragonfly.py index b915fd6ec..eeb6d2d8f 100644 --- a/python/ray/tune/suggest/dragonfly.py +++ b/python/ray/tune/suggest/dragonfly.py @@ -93,8 +93,10 @@ class DragonflySearch(SuggestionAlgorithm): "Setting `metric={}` and `mode=max`.".format(reward_attr)) self._initial_points = [] + self._opt = optimizer + self._opt.initialise() if points_to_evaluate and evaluated_rewards: - optimizer.tell(points_to_evaluate, evaluated_rewards) + self._opt.tell([(points_to_evaluate, evaluated_rewards)]) elif points_to_evaluate: self._initial_points = points_to_evaluate self._max_concurrent = max_concurrent @@ -104,8 +106,6 @@ class DragonflySearch(SuggestionAlgorithm): self._metric_op = -1. elif mode == "max": self._metric_op = 1. - self._opt = optimizer - self._opt.initialise() self._live_trial_mapping = {} super(DragonflySearch, self).__init__( metric=self._metric, mode=mode, **kwargs)