@@ -233,7 +233,7 @@ def __init__(
233233
234234 # The writer (Tensorboard) must be initialized before the surrogate model,
235235 # because the writer is passed to the surrogate model:
236- self .init_spot_writer ()
236+ self ._init_spot_writer ()
237237
238238 self ._surrogate_setup (surrogate )
239239
@@ -862,6 +862,8 @@ def run(self, X_start: np.ndarray = None) -> Spot:
862862 self .initialize_design (X_start )
863863 self .update_stats ()
864864 self .fit_surrogate ()
865+ if self .verbosity > 0 :
866+ print ("\n ------ Starting optimization on the Surrogate for the given Budget ------\n " )
865867 timeout_start = time .time ()
866868 while self .should_continue (timeout_start ):
867869 self .update_design ()
@@ -1083,7 +1085,7 @@ def evaluate_initial_design(self) -> None:
10831085 logger .debug ("In Spot() evaluate_initial_design(), before calling self.fun: fun_control: %s" , self .fun_control )
10841086
10851087 self .y = self .fun (X = X_all , fun_control = self .fun_control )
1086- self .y = apply_penalty_NA (self .y , self .fun_control ["penalty_NA" ])
1088+ self .y = apply_penalty_NA (self .y , self .fun_control ["penalty_NA" ], verbosity = self . verbosity )
10871089 logger .debug ("In Spot() evaluate_initial_design(), after calling self.fun: self.y: %s" , self .y )
10881090
10891091 # TODO: Error if only nan values are returned
@@ -1410,7 +1412,7 @@ def update_design(self) -> None:
14101412 )
14111413 # (S-18): Evaluating New Solutions:
14121414 y0 = self .fun (X = X_all , fun_control = self .fun_control )
1413- y0 = apply_penalty_NA (y0 , self .fun_control ["penalty_NA" ])
1415+ y0 = apply_penalty_NA (y0 , self .fun_control ["penalty_NA" ], verbosity = self . verbosity )
14141416 X0 , y0 = remove_nan (X0 , y0 , stop_on_zero_return = False )
14151417 # Append New Solutions (only if they are not nan):
14161418 if y0 .shape [0 ] > 0 :
@@ -1580,7 +1582,7 @@ def _get_pickle_safe_spot_tuner(self, unpickleables="file_io", verbosity=0) -> S
15801582
15811583 return picklable_instance
15821584
1583- def init_spot_writer (self ) -> None :
1585+ def _init_spot_writer (self ) -> None :
15841586 """
15851587 Initialize the spot_writer for the current experiment if in fun_control
15861588 the tensorboard_log is set to True
@@ -1590,7 +1592,7 @@ def init_spot_writer(self) -> None:
15901592 if self .fun_control ["tensorboard_log" ] and self .fun_control ["spot_tensorboard_path" ] is not None :
15911593 self .spot_writer = SummaryWriter (log_dir = self .fun_control ["spot_tensorboard_path" ])
15921594 if self .verbosity > 0 :
1593- print (f"Created spot_tensorboard_path: { self .fun_control ['spot_tensorboard_path' ]} for SummaryWriter()" )
1595+ print (f"_init_spot_writer(): Created spot_tensorboard_path: { self .fun_control ['spot_tensorboard_path' ]} for SummaryWriter()" )
15941596 else :
15951597 self .spot_writer = None
15961598 if self .verbosity > 0 :
@@ -1643,7 +1645,7 @@ def generate_random_point(self):
16431645 logger .debug ("In Spot() generate_random_point(), before calling self.fun: X_all: %s" , X_all )
16441646 logger .debug ("In Spot() generate_random_point(), before calling self.fun: fun_control: %s" , self .fun_control )
16451647 y0 = self .fun (X = X_all , fun_control = self .fun_control )
1646- y0 = apply_penalty_NA (y0 , self .fun_control ["penalty_NA" ])
1648+ y0 = apply_penalty_NA (y0 , self .fun_control ["penalty_NA" ], verbosity = self . verbosity )
16471649 X0 , y0 = remove_nan (X0 , y0 , stop_on_zero_return = False )
16481650 return X0 , y0
16491651
@@ -1978,7 +1980,7 @@ def plot_model(self, y_min=None, y_max=None) -> None:
19781980 if self .k == 1 :
19791981 X_test = np .linspace (self .lower [0 ], self .upper [0 ], 100 )
19801982 y_test = self .fun (X = X_test .reshape (- 1 , 1 ), fun_control = self .fun_control )
1981- y_test = apply_penalty_NA (y_test , self .fun_control ["penalty_NA" ])
1983+ y_test = apply_penalty_NA (y_test , self .fun_control ["penalty_NA" ], verbosity = self . verbosity )
19821984 if isinstance (self .surrogate , Kriging ):
19831985 y_hat = self .surrogate .predict (X_test [:, np .newaxis ], return_val = "y" )
19841986 else :
0 commit comments