Skip to content

Commit 4550969

Browse files
committed
A bit more printing
1 parent de1b3c3 commit 4550969

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

libensemble/tests/unit_tests/test_aposmm_starting_point_finder.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
decide_where_to_start_localopt,
66
)
77
from libensemble.sim_funcs.six_hump_camel import six_hump_camel_func
8+
from libensemble.tests.regression_tests.support import six_hump_camel_minima as known_minima
89

910

1011
def setup_history_and_find_rk(n_s, num_to_start, lb, ub, f_vals, x_points):
@@ -90,7 +91,7 @@ def setup_history_and_find_rk(n_s, num_to_start, lb, ub, f_vals, x_points):
9091
dim = len(lb)
9192

9293
# Number of sample points and desired number of start points
93-
num_samples = 100
94+
num_samples = 1000
9495
num_to_start = 6
9596

9697
# Generate random sample points uniformly in the [lb,ub] box
@@ -104,6 +105,10 @@ def setup_history_and_find_rk(n_s, num_to_start, lb, ub, f_vals, x_points):
104105

105106
assert len(inds_to_start) == num_to_start, f"Found {len(inds_to_start)} starting points instead of {num_to_start}"
106107

108+
starting_pts = H['x'][inds_to_start]
109+
110+
print(f"For this problem, we know the minima. The chosen starting points: \n{starting_pts[np.lexsort(starting_pts.T[::-1])]}\nshoudl be close to the known minima: \n{known_minima[np.lexsort(known_minima.T[::-1])]}")
111+
107112
# Output results
108113
print(f"Chosen r_k: {rk_final:.6f}")
109114
print(f"Indices to start local optimization (num_to_start={num_to_start}): {inds_to_start}")

0 commit comments

Comments
 (0)