From d24db86e212a09fc536627fbf99ac45583e8948d Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 2 Oct 2024 09:38:11 +0200 Subject: [PATCH] ESSOptimizer: Fix recombination bug (#1477) This fixes a bug in the recombination step of the `ESSOptimizer`, also used by `SacessOptimizer`. This will in particular improve performance when using scatter search without local optimizers. --- pypesto/optimize/ess/ess.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pypesto/optimize/ess/ess.py b/pypesto/optimize/ess/ess.py index 479c67c61..c53b56837 100644 --- a/pypesto/optimize/ess/ess.py +++ b/pypesto/optimize/ess/ess.py @@ -443,11 +443,15 @@ def _combine(self, i, j) -> np.array: raise ValueError("i == j") x = self.refset.x - d = x[j] - x[i] - alpha = np.sign(j - i) + d = (x[j] - x[i]) / 2 + # i < j implies f(x_i) < f(x_j) + alpha = 1 if i < j else -1 + # beta is a relative rank-based distance between the two parents + # 0 <= beta <= 1 beta = (np.abs(j - i) - 1) / (self.refset.dim - 2) + # new hyper-rectangle, biased towards the better parent c1 = x[i] - d * (1 + alpha * beta) - c2 = x[i] - d * (1 - alpha * beta) + c2 = x[i] + d * (1 - alpha * beta) # this will not always yield admissible points -> clip to bounds ub, lb = self.evaluator.problem.ub, self.evaluator.problem.lb