Skip to content

Commit

Permalink
fix retransforming of incumbents
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronkl committed Sep 7, 2016
1 parent 63c7162 commit 3eb3329
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions robo/fmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, X_lower, X_upper, objective_fkt):
results = dict()
results["x_opt"] = task.retransform(x_best)
results["f_opt"] = f_min
results["trajectory"] = task.retransform(bo.incumbents)
results["trajectory"] = [task.retransform(inc) for inc in bo.incumbents]
results["runtime"] = bo.runtime
results["overhead"] = bo.time_overhead
return results
Expand Down Expand Up @@ -274,7 +274,7 @@ def basis_function(x):

results = dict()
results["x_opt"] = task.retransform(x_best)
results["trajectory"] = task.retransform(bo.incumbents)
results["trajectory"] = [task.retransform(inc) for inc in bo.incumbents]
results["runtime"] = bo.runtime
results["overhead"] = bo.time_overhead
return results
Expand Down Expand Up @@ -440,7 +440,7 @@ def bf(x):

results = dict()
results["x_opt"] = task.retransform(x_best)
results["trajectory"] = task.retransform(bo.incumbents)
results["trajectory"] = [task.retransform(inc) for inc in bo.incumbents]
results["runtime"] = bo.runtime
results["overhead"] = bo.time_overhead
return results
4 changes: 2 additions & 2 deletions robo/solver/bayesian_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def run(self, num_iterations=10, X=None, Y=None):
self.incumbent = np.array([self.X[best_idx]])
self.incumbent_value = np.array([self.Y[best_idx]])

self.incumbents.append(self.incumbent)
self.incumbents.append(self.incumbent[0, :])
self.incumbent_values.append(self.incumbent_value)
self.runtime.append(time.time() - self.start_time)

Expand Down Expand Up @@ -189,7 +189,7 @@ def run(self, num_iterations=10, X=None, Y=None):
self.incumbent, self.incumbent_value = \
self.estimator.estimate_incumbent(startpoints)

self.incumbents.append(self.incumbent)
self.incumbents.append(self.incumbent[0, :])
self.incumbent_values.append(self.incumbent_value)

logger.info("New incumbent %s found in %f seconds with "
Expand Down

0 comments on commit 3eb3329

Please sign in to comment.