Skip to content

Commit ee6a7c5

Browse files
committed
Reset slow iteration counter when doing soft restarts. Fixes #18
1 parent a82ddfe commit ee6a7c5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pybobyqa/controller.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,11 @@ def soft_restart(self, number_of_samples, nruns_so_far, params, x_in_abs_coords_
505505
self.delta = self.rhobeg
506506
self.rho = self.rhobeg
507507
self.diffs = [0.0, 0.0, 0.0]
508+
509+
# Forget history of slow iterations
510+
self.last_iters_step_taken = []
511+
self.last_fopts_step_taken = []
512+
self.num_slow_iters = 0
508513

509514
all_sq_dist = self.model.distances_to_xopt()[:self.model.npt()]
510515
closest_points = np.argsort(all_sq_dist)

0 commit comments

Comments
 (0)