Skip to content

Commit

Permalink
add meta_learn integration
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Oct 5, 2019
1 parent c5b2f00 commit 594ac63
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hyperactive/base_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from .base_positioner import BasePositioner
from .util import initialize_search, finish_search_, sort_for_best
from meta_learn import HyperactiveWrapper


class BaseOptimizer:
Expand Down Expand Up @@ -56,6 +57,9 @@ def __init__(self, _config_, _arg_):
self.search_config = self._config_.search_config
self.n_iter = self._config_.n_iter

if self._config_.meta_learn:
self._meta_ = HyperactiveWrapper(self._config_.search_config)

if self._config_.get_search_path:
self.pos_list = []
self.score_list = []
Expand Down Expand Up @@ -144,6 +148,11 @@ def _run_one_job(self, X, y):
print("\nscore =", self.score_best)
print("start_point =", start_point)

print([_cand_])

if self._config_.meta_learn:
self._meta_.collect(X, y, _cand_list=[_cand_])

def _run_multiple_jobs(self, X, y):
_cand_list = self._search_multiprocessing(X, y)

Expand Down

0 comments on commit 594ac63

Please sign in to comment.