Skip to content

Commit

Permalink
ESSOptimizer: Fix bug in go-beyond
Browse files Browse the repository at this point in the history
Fixes some issues related to copies vs views, that stopped the go-beyond search prematurely.
  • Loading branch information
dweindl committed Oct 2, 2024
1 parent d24db86 commit dec6b6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pypesto/optimize/ess/ess.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def _do_local_search(
def _maybe_update_global_best(self, x, fx):
"""Update the global best value if the provided value is better."""
if fx < self.fx_best:
self.x_best = x[:]
self.x_best[:] = x
self.fx_best = fx
self.x_best_has_changed = True
self.history.update(
Expand All @@ -583,9 +583,9 @@ def _go_beyond(self, x_best_children, fx_best_children):
continue

# offspring is better than parent
x_parent = self.refset.x[i]
x_parent = self.refset.x[i].copy()
fx_parent = self.refset.fx[i]
x_child = x_best_children[i]
x_child = x_best_children[i].copy()
fx_child = fx_best_children[i]
improvement = 1
# Multiplier used in determining the hyper-rectangle from which to
Expand Down

0 comments on commit dec6b6c

Please sign in to comment.