Skip to content

Commit 69ed15a

Browse files
committed
address comments
1 parent 3b2ab5d commit 69ed15a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Drivers/hiopbbpy/BODriver.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,24 @@
9696
# np.save("yopt_20iter_1000run.npy", y_opt)
9797

9898
# Define percentiles
99-
left_percentile = 5 # or 1
99+
left_percentile = 1 # 5 or 1
100100
right_percentile = 100 - left_percentile # 95 or 99
101101

102102
print("Summary:")
103103
for prob_type in prob_type_l:
104104
for acq_type in acq_type_l:
105-
allowed_error = max(1e-6, 0.01*(saved_max_obj[prob_type][acq_type]-saved_min_obj[prob_type][acq_type]))
106-
107105
mean_obj[prob_type][acq_type] /= num_repeat
108106
print("(Min,Mean,Max) Opt.Obj for", prob_type, "-", acq_type, ":\t(", min_obj[prob_type][acq_type], ",",mean_obj[prob_type][acq_type], ",", max_obj[prob_type][acq_type], ")")
109107

110108
### verify the results with the saved results
111109
left_value = np.percentile(saved_yopt[prob_type][acq_type], left_percentile)
112110
right_value = np.percentile(saved_yopt[prob_type][acq_type], right_percentile)
113111

114-
lb = left_value - allowed_error
115-
ub = right_value + allowed_error
116-
117-
is_failed = (y_opt[prob_type][acq_type] < lb) | (y_opt[prob_type][acq_type] > ub)
112+
is_failed = (y_opt[prob_type][acq_type] < left_value) | (y_opt[prob_type][acq_type] > right_value)
118113
num_fail = np.sum(is_failed)
119114

120-
if num_fail > 1:
115+
# currently ci test is only applied to num_repeat == 10
116+
if num_fail >= 3 and num_repeat == 10:
121117
print(num_fail, "test(s) fail(s):", y_opt[prob_type][acq_type][is_failed])
122118
print("Recorded (min, mean, max): (", saved_min_obj[prob_type][acq_type], ",", saved_mean_obj[prob_type][acq_type], ",", saved_max_obj[prob_type][acq_type], ")")
123119
retval = 1

0 commit comments

Comments
 (0)