From 14d59effbe628aae0066b1c80acd8d76aa4530bd Mon Sep 17 00:00:00 2001 From: "Chi Wang (MSR)" Date: Fri, 5 Feb 2021 22:45:02 -0800 Subject: [PATCH] bug fix --- docs/index.rst | 5 +++-- flaml/ml.py | 2 +- flaml/searcher/blendsearch.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index e47e9fc5f..f56acbfb5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,8 +24,9 @@ AutoML Tune ------ -.. automodule:: flaml.tune - :members: +.. autofunction:: flaml.tune.run + +.. autofunction:: flaml.tune.report .. autoclass:: flaml.BlendSearch :members: diff --git a/flaml/ml.py b/flaml/ml.py index 90093cf2b..76f053355 100644 --- a/flaml/ml.py +++ b/flaml/ml.py @@ -258,7 +258,7 @@ def train_estimator(X_train, y_train, config_dic, task, n_jobs=n_jobs) if X_train is not None: train_time = train_model(estimator, X_train, y_train, budget, - **fit_kwargs) + fit_kwargs) else: estimator = estimator.estimator_class(**estimator.params) train_time = time.time() - start_time diff --git a/flaml/searcher/blendsearch.py b/flaml/searcher/blendsearch.py index 97d12bd7b..adca20c56 100644 --- a/flaml/searcher/blendsearch.py +++ b/flaml/searcher/blendsearch.py @@ -396,15 +396,15 @@ class BlendSearch(Searcher): class CFO(BlendSearch): ''' class for CFO algorithm - Number of threads is 1 or 2. Thread 0 is a vacuous thread. ''' __name__ = 'CFO' def suggest(self, trial_id: str) -> Optional[Dict]: + # Number of threads is 1 or 2. Thread 0 is a vacuous thread assert len(self._search_thread_pool)<3, len(self._search_thread_pool) if len(self._search_thread_pool) < 2: - # When a local converges, the number of threads is 1. + # When a local converges, the number of threads is 1 # Need to restart self._init_used = False return super().suggest(trial_id)