Skip to content

Commit 174e788

Browse files
committed
I sneezed, sorry -- uncommented
1 parent 84380fe commit 174e788

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

bayes_opt/domain_reduction.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,16 @@ def _trim(self, new_bounds: np.array, global_bounds: np.array) -> np.array:
106106
window_width = abs(entry[0] - entry[1])
107107
if window_width < self.minimum_window[i]:
108108
dw = (self.minimum_window[i] - window_width) / 2.0
109-
new_bounds[i, 0] -= dw
110-
new_bounds[i, 1] += dw
111-
# left_expansion_space = abs(global_bounds[i, 0] - entry[0]) # should be non-positive
112-
# right_expansion_space = abs(global_bounds[i, 1] - entry[1]) # should be non-negative
113-
# # conservative
114-
# dw_l = min(dw, left_expansion_space)
115-
# dw_r = min(dw, right_expansion_space)
116-
# # this crawls towards the edge
117-
# ddw_r = dw_r + max(dw - dw_l, 0)
118-
# ddw_l = dw_l + max(dw - dw_r, 0)
119-
# new_bounds[i, 0] -= ddw_l
120-
# new_bounds[i, 1] += ddw_r
109+
left_expansion_space = abs(global_bounds[i, 0] - entry[0]) # should be non-positive
110+
right_expansion_space = abs(global_bounds[i, 1] - entry[1]) # should be non-negative
111+
# conservative
112+
dw_l = min(dw, left_expansion_space)
113+
dw_r = min(dw, right_expansion_space)
114+
# this crawls towards the edge
115+
ddw_r = dw_r + max(dw - dw_l, 0)
116+
ddw_l = dw_l + max(dw - dw_r, 0)
117+
new_bounds[i, 0] -= ddw_l
118+
new_bounds[i, 1] += ddw_r
121119
return new_bounds
122120

123121
def _create_bounds(self, parameters: dict, bounds: np.array) -> dict:

0 commit comments

Comments
 (0)