Skip to content

Commit 496af94

Browse files
committed
Reduced cognitive complexity
1 parent 290a860 commit 496af94

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel_tuner/strategies/bayes_opt.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -860,10 +860,8 @@ def __optimize_multi_ultrafast(self, max_fevals, predict_eval_ratio=5):
860860
while self.fevals < max_fevals:
861861
aqfs = self.multi_afs
862862
# if we take the prediction only once, we want to go from most exploiting to most exploring, because the more exploiting an AF is, the more it relies on non-stale information from the model
863-
if (
864-
last_prediction_time * predict_eval_ratio <= last_eval_time
865-
or last_prediction_counter >= predict_eval_ratio
866-
):
863+
fit_observations = last_prediction_time * predict_eval_ratio <= last_eval_time or last_prediction_counter >= predict_eval_ratio
864+
if fit_observations:
867865
last_prediction_counter = 0
868866
pred_start = time.perf_counter()
869867
if last_eval_time > 0.0:

0 commit comments

Comments
 (0)