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

Loose coupling nsgaii elite population selection #4821

Conversation

Alnusjaponica
Copy link
Collaborator

@Alnusjaponica Alnusjaponica commented Jul 21, 2023

Motivation

Progress v3.3 task to make NSGAII Sampler loose coupled.

Description of the changes

Add _elite_population_selection_strategy argument to the constructor if NSGAIISampler and separate the elite population selection process so that users can customize surviving process.

Please merge this PR after #4806 is merged.

@github-actions github-actions bot added the optuna.samplers Related to the `optuna.samplers` submodule. This is automatically labeled by github-actions. label Jul 21, 2023
@Alnusjaponica Alnusjaponica force-pushed the loose-coupling-NSGAII-elite-population-selection branch from 8fb39b3 to d511a75 Compare July 21, 2023 06:56
@Alnusjaponica Alnusjaponica changed the title [DO NOT MERGE] Loose coupling nsgaii elite population selection Loose coupling nsgaii elite population selection Jul 24, 2023
@Alnusjaponica Alnusjaponica marked this pull request as ready for review July 24, 2023 10:50
@toshihikoyanase
Copy link
Member

@HideakiImamura Could you review this PR, please?

Copy link
Member

@HideakiImamura HideakiImamura left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I have two comments. PTAL.

Copy link
Member

Choose a reason for hiding this comment

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

Just for confirmation. The loose coupling of the elite population selection for the NSGAIIISampler will be done as a follow-up?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I am going to do it as a follow-up.

optuna/samplers/nsgaii/_sampler.py Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2023

Codecov Report

Merging #4821 (2193feb) into master (d2409f9) will increase coverage by 0.01%.
Report is 68 commits behind head on master.
The diff coverage is 97.14%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #4821      +/-   ##
==========================================
+ Coverage   89.53%   89.55%   +0.01%     
==========================================
  Files         197      198       +1     
  Lines       14671    14689      +18     
==========================================
+ Hits        13135    13154      +19     
+ Misses       1536     1535       -1     
Files Changed Coverage Δ
optuna/integration/sklearn.py 97.15% <85.71%> (-0.24%) ⬇️
optuna/samplers/nsgaii/_dominates_function.py 92.15% <90.90%> (-0.35%) ⬇️
...ers/nsgaii/_elite_population_selection_strategy.py 98.75% <98.75%> (ø)
optuna/samplers/_nsgaiii.py 97.56% <100.00%> (-0.07%) ⬇️
optuna/samplers/nsgaii/_sampler.py 96.33% <100.00%> (-0.36%) ⬇️

... and 13 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. Let me share my early comments.

optuna/samplers/_nsgaiii.py Show resolved Hide resolved
optuna/samplers/nsgaii/_sampler.py Outdated Show resolved Hide resolved
Copy link
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

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

I have a comment on the reference. I guess the strategies are still private.

optuna/samplers/nsgaii/_sampler.py Outdated Show resolved Hide resolved
Comment on lines 117 to 122
.. note::

The arguments ``elite_population_selection_strategy``,
``child_generation_strategy``, and ``after_trial_strategy`` was added in v3.3.0 as
an experimental feature. The interface may change in newer versions without prior
notice. See https://github.com/optuna/optuna/releases/tag/v3.3.0.
Copy link
Member

Choose a reason for hiding this comment

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

It seems the note has been added to only one argument, specifically after_trial_strategy, and not to all three. While it might seem redundant, would it be worth considering adding similar notes to elite_population_selection_strategy and child_generation_strategy as well?

image

Copy link
Member

@HideakiImamura HideakiImamura left a comment

Choose a reason for hiding this comment

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

LGTM except @toshihikoyanase's comment.

@HideakiImamura HideakiImamura removed their assignment Aug 1, 2023
@HideakiImamura HideakiImamura added the code-fix Change that does not change the behavior, such as code refactoring. label Aug 1, 2023
@HideakiImamura HideakiImamura added this to the v3.3.0 milestone Aug 1, 2023
Copy link
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

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

Thank you for your update. The readthedocs CI job failed, but I believe it is unrelated to the changes in this PR. LGTM!

@toshihikoyanase toshihikoyanase merged commit 846e95d into optuna:master Aug 2, 2023
30 of 31 checks passed
@Alnusjaponica Alnusjaponica deleted the loose-coupling-NSGAII-elite-population-selection branch August 2, 2023 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-fix Change that does not change the behavior, such as code refactoring. optuna.samplers Related to the `optuna.samplers` submodule. This is automatically labeled by github-actions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants