Skip to content
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

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Oct 2, 2024

Fixes some issues related to copies vs views that stopped the go-beyond search prematurely after the first successful step.

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.90%. Comparing base (d24db86) to head (dec6b6c).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1480      +/-   ##
===========================================
- Coverage    82.91%   82.90%   -0.02%     
===========================================
  Files          163      163              
  Lines        13786    13786              
===========================================
- Hits         11431    11429       -2     
- Misses        2355     2357       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Fixes some issues related to copies vs views, that stopped the go-beyond search prematurely.
Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks. I added some questions for my own clarification 🙏🏼

@@ -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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do i see correctly that the problem was that x_parent/child are edited further below and thus edit the reset itself?

Copy link
Member Author

Choose a reason for hiding this comment

The 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, x_parent would become identical to x_child.

@@ -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
Copy link
Collaborator

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?

Copy link
Member Author

@dweindl dweindl Oct 7, 2024

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.

@dweindl dweindl merged commit b091d46 into ICB-DCM:develop Oct 8, 2024
18 checks passed
@dweindl dweindl deleted the fix_ess_gobeyond branch October 8, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants