Skip to content

Commit 087cdee

Browse files
committed
wip
1 parent 42eaf5c commit 087cdee

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

bayes_opt/bayesian_optimization.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,33 @@ def init(self, init_points):
126126
# Updates the flag
127127
self.initialized = True
128128

129+
def eval_points(self, points):
130+
"""
131+
Evaulates specific points and adds them to the set of known
132+
observations self.X and self.Y
133+
"""
134+
if self.X is None and self.Y is None:
135+
self.X = np.empty((0, self.bounds.shape[0]))
136+
self.Y = np.empty(0)
137+
138+
new_Xs = []
139+
new_Ys = []
140+
141+
for x in points:
142+
x = np.asarray(x).reshape((1, -1))
143+
y = self.f(**dict(zip(self.keys, x)))
144+
145+
new_Xs.append(x)
146+
new_Ys.append(y)
147+
148+
if self.verbose:
149+
self.plog.print_step(x, self.Y[-1])
150+
151+
# Append the evaluated points
152+
self.X = np.vstack([self.X] + new_Xs)
153+
self.Y = np.hstack([self.Y] + new_Ys)
154+
155+
129156
def explore(self, points_dict):
130157
"""Method to explore user defined points
131158

0 commit comments

Comments
 (0)