Skip to content

Commit 841db4b

Browse files
authored
Merge pull request #54 from aaronkl/fix
fix indentation for H2BO
2 parents 116b0c4 + 29cc35c commit 841db4b

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

hpbandster/optimizers/config_generators/h2bo.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def new_result(self, job, update_model=True):
229229

230230
tmp = np.array([np.mean(r) for r in self.losses[budget]])
231231
if np.sum(np.isfinite(tmp)) < min_num_points:
232-
self.logger.debug("Only %i successful run(s) for budget %f available, need more than %s -> can't build model!"%(np.sum(np.isfinite(self.losses[budget])), budget, min_num_points))
232+
self.logger.debug("Only %i successful run(s) for budget %f available, need more than %s -> can't build model!"%(np.sum(np.isfinite(tmp)), budget, min_num_points))
233233
return
234234

235235
# b) during warnm starting when we feed previous results in and only update once
@@ -267,15 +267,6 @@ def new_result(self, job, update_model=True):
267267

268268
if self.bw_estimator in ['mlcv'] and n_good < 3:
269269
self.kde_models[budget]['good'].bandwidths[:] = self.kde_models[budget]['bad'].bandwidths
270-
271-
print('='*50)
272-
print(self.kde_models[budget]['good'].bandwidths)
273-
#print('best:\n',self.kde_models[budget]['good'].data[0])
274-
print(self.kde_models[budget]['good'].data.mean(axis=0))
275-
print(self.kde_models[budget]['good'].data.std(axis=0))
276-
print((train_losses[idx])[:n_good])
277-
278-
print(self.kde_models[budget]['bad'].bandwidths)
279270

280271
# update probs for the categorical parameters for later sampling
281272
self.logger.debug('done building a new model for budget %f based on %i/%i split\nBest loss for this budget:%f\n\n\n\n\n'%(budget, n_good, n_bad, np.min(train_losses)))

hpbandster/optimizers/kde/kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def sample(self, sample_indices=None, num_samples=1):
169169
"""
170170
if sample_indices is None:
171171
sample_indices = np.random.choice(self.data.shape[0], size=num_samples)
172-
samples = self.data[sample_indices]
172+
samples = self.data[sample_indices]
173173

174174
possible_steps = np.arange(-self.num_values+1,self.num_values)
175175
idx = (np.abs(possible_steps) < 1e-2)

0 commit comments

Comments
 (0)