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 priority for local search startpoints #1503

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Nov 4, 2024

Fixes a bug in ESSOptimizer that lead to incorrect priorities for the selection of candidate solutions for local searches. A numpy array was incorrectly initialized from a generator, which led to the balance hyperparameter being practically ignored, and candidate solutions being ranked only by objective function value.

Fixes a bug in ESSOptimizer that lead to incorrect priorities for the selection of candidate solutions for local searches.
A numpy array was incorrectly initialized from a generator, which led to the `balance` hyperparameter being practically ignored, and candidate solutions being ranked only by objective function value.
@dweindl dweindl self-assigned this Nov 4, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 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.69%. Comparing base (a82e637) to head (6ed8e0c).

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1503      +/-   ##
===========================================
- Coverage    82.72%   82.69%   -0.03%     
===========================================
  Files          163      163              
  Lines        13896    13896              
===========================================
- Hits         11495    11491       -4     
- Misses        2401     2405       +4     

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

@dweindl dweindl marked this pull request as ready for review November 5, 2024 07:25
Copy link
Contributor

@Doresic Doresic 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!

So it's better to use from_iter in cases when we want to use the output as a numpy array rather than a generator? Because generators sometimes mess up as they don't behave like numpy arrays in all cases?

@dweindl
Copy link
Member Author

dweindl commented Nov 5, 2024

So it's better to use from_iter in cases when we want to use the output as a numpy array rather than a generator? Because generators sometimes mess up as they don't behave like numpy arrays in all cases?

Not just better, but necessary. numpy.array(some_generator) will not execute the generator, but store it as such. Not only generators, but all iterators.

@dweindl dweindl merged commit c8640ff into ICB-DCM:develop Nov 5, 2024
18 checks passed
@dweindl dweindl deleted the fix_ess_distances branch November 5, 2024 15:00
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