-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESSOptimizer: Fix bug in go-beyond #1480
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( | ||
|
@@ -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() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do i see correctly that the problem was that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem was not so much editing the refset per se, but that in the second inner iteration, |
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this related to the go-beyond algorithm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not. But it's another potential (non-)copying issue.