Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix bug in cold start #803

Merged
merged 2 commits into from
Mar 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/sdk/pynni/nni/metis_tuner/metis_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def generate_parameters(self, parameter_id):
-------
result : dict
"""
if self.samples_x or len(self.samples_x) < self.cold_start_num:
if len(self.samples_x) < self.cold_start_num:
init_parameter = _rand_init(self.x_bounds, self.x_types, 1)[0]
results = self._pack_output(init_parameter)
else:
Expand Down Expand Up @@ -340,7 +340,7 @@ def _selection(self, samples_x, samples_y_aggregation, samples_y,
results_outliers = gp_outlier_detection.outlierDetection_threaded(samples_x, samples_y_aggregation)

if results_outliers is not None:
temp = len(candidates)
# temp = len(candidates)

for results_outlier in results_outliers:
if _num_past_samples(samples_x[results_outlier['samples_idx']], samples_x, samples_y) < max_resampling_per_x:
Expand Down Expand Up @@ -370,13 +370,6 @@ def _selection(self, samples_x, samples_y_aggregation, samples_y,
temp_improvement = threads_result['expected_lowest_mu'] - lm_current['expected_mu']

if next_improvement > temp_improvement:
logger.infor("DEBUG: \"next_candidate\" changed: \
lowest mu might reduce from %f (%s) to %f (%s), %s\n" %\
lm_current['expected_mu'], str(lm_current['hyperparameter']),\
threads_result['expected_lowest_mu'],\
str(threads_result['candidate']['hyperparameter']),\
threads_result['candidate']['reason'])

next_improvement = temp_improvement
next_candidate = threads_result['candidate']
else:
Expand Down