Skip to content

Commit

Permalink
ESSOptimizer: Fix recombination bug (#1477)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dweindl authored Oct 2, 2024
1 parent b1f6ea8 commit d24db86
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pypesto/optimize/ess/ess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d24db86

Please sign in to comment.