@@ -75,7 +75,7 @@ def _generate_mesh(lb, ub, num_points=10):
7575 return points
7676
7777
78- def _eval_var (my_gp2S , all_x , all_y , x_for_var , test_points , persis_info ):
78+ def _eval_var (my_gp , all_x , all_y , x_for_var , test_points , persis_info ):
7979 """
8080 Evaluate the posterior covariance at points in x_for_var.
8181 If we have test points, calculate mean square error at those points.
@@ -87,7 +87,7 @@ def _eval_var(my_gp2S, all_x, all_y, x_for_var, test_points, persis_info):
8787
8888 for start_idx in range (0 , n_rows , group_size ):
8989 end_idx = min (start_idx + group_size , n_rows )
90- var_vals_group = my_gp2S .posterior_covariance (x_for_var [start_idx :end_idx ], variance_only = True )["v(x)" ]
90+ var_vals_group = my_gp .posterior_covariance (x_for_var [start_idx :end_idx ], variance_only = True )["v(x)" ]
9191 var_vals .extend (var_vals_group )
9292
9393 assert len (var_vals ) == n_rows , "Something wrong with the grouping"
@@ -96,7 +96,7 @@ def _eval_var(my_gp2S, all_x, all_y, x_for_var, test_points, persis_info):
9696 persis_info .setdefault ("mean_variance" , []).append (np .mean (var_vals ))
9797
9898 if test_points is not None :
99- f_est = my_gp2S .posterior_mean (test_points ["x" ])["f(x)" ]
99+ f_est = my_gp .posterior_mean (test_points ["x" ])["f(x)" ]
100100 mse = np .mean ((f_est - test_points ["f" ]) ** 2 )
101101 persis_info .setdefault ("mean_squared_error" , []).append (mse )
102102
@@ -151,7 +151,7 @@ def persistent_gpCAM_simple(H_in, persis_info, gen_specs, libE_info):
151151 `test_gpCAM.py <https://github.com/Libensemble/libensemble/blob/develop/libensemble/tests/regression_tests/test_gpCAM.py>`_
152152 """ # noqa
153153 U = gen_specs ["user" ]
154- my_gp2S = None
154+ my_gp = None
155155 noise = 1e-12
156156
157157 test_points = _read_testpoints (U )
@@ -202,15 +202,15 @@ def persistent_gpCAM_simple(H_in, persis_info, gen_specs, libE_info):
202202 all_x = np .vstack ((all_x , x_new ))
203203 all_y = np .vstack ((all_y , y_new ))
204204
205- if my_gp2S is None :
206- my_gp2S = GP (all_x , all_y , noise_variances = noise * np .ones (len (all_y )))
205+ if my_gp is None :
206+ my_gp = GP (all_x , all_y , noise_variances = noise * np .ones (len (all_y )))
207207 else :
208- my_gp2S .tell (all_x , all_y , noise_variances = noise * np .ones (len (all_y )))
209- my_gp2S .train ()
208+ my_gp .tell (all_x , all_y , noise_variances = noise * np .ones (len (all_y )))
209+ my_gp .train ()
210210
211211 if not U .get ("use_grid" ):
212212 x_for_var = persis_info ["rand_stream" ].uniform (lb , ub , (10 * batch_size , n ))
213- var_vals = _eval_var (my_gp2S , all_x , all_y , x_for_var , test_points , persis_info )
213+ var_vals = _eval_var (my_gp , all_x , all_y , x_for_var , test_points , persis_info )
214214
215215 return H_o , persis_info , FINISHED_PERSISTENT_GEN_TAG
216216
@@ -242,15 +242,15 @@ def persistent_gpCAM_ask_tell(H_in, persis_info, gen_specs, libE_info):
242242
243243 if first_call :
244244 # Initialize GP
245- my_gp2S = GP (all_x , all_y , noise_variances = 1e-8 * np .ones (len (all_y )))
245+ my_gp = GP (all_x , all_y , noise_variances = 1e-8 * np .ones (len (all_y )))
246246 first_call = False
247247 else :
248- my_gp2S .tell (all_x , all_y , noise_variances = 1e-8 * np .ones (len (all_y )))
248+ my_gp .tell (all_x , all_y , noise_variances = 1e-8 * np .ones (len (all_y )))
249249
250- my_gp2S .train ()
250+ my_gp .train ()
251251
252252 start = time .time ()
253- x_new = my_gp2S .ask (
253+ x_new = my_gp .ask (
254254 bounds = np .column_stack ((lb , ub )),
255255 n = batch_size ,
256256 pop_size = batch_size ,
0 commit comments