Repository navigation
Add BaseGASampler - #5864
Merged
Merged
Add BaseGASampler#5864
BaseGASampler#5864Conversation
gen740
force-pushed
the
base_ga_sampler
branch
from
December 20, 2024 05:43
c2b7f4e to
fe65e1b
Compare
gen740
marked this pull request as ready for review
December 20, 2024 06:36
Contributor
|
This pull request has not seen any recent activity. |
Member
|
@y0z Could you review this PR? |
Member
|
@porink0424 Could you review this PR? |
Contributor
|
This pull request has not seen any recent activity. |
Contributor
|
This pull request has not seen any recent activity. |
y0z
reviewed
Jan 23, 2025
y0z
left a comment
Member
There was a problem hiding this comment.
I leave some comments on _base.py.
y0z
reviewed
Jan 24, 2025
| return [study._storage.get_trial(trial_id) for trial_id in cached_parent_population] | ||
| else: | ||
| parent_population = self.select_parent(study, generation) | ||
| study._storage.set_study_system_attr( |
gen740
force-pushed
the
base_ga_sampler
branch
from
January 29, 2025 04:15
b794be9 to
dcf1b9b
Compare
porink0424
reviewed
Jan 29, 2025
porink0424
left a comment
Member
There was a problem hiding this comment.
I've left a few comments, please take a look.
gen740
force-pushed
the
base_ga_sampler
branch
from
January 29, 2025 05:18
dcf1b9b to
762a365
Compare
porink0424
reviewed
Jan 29, 2025
gen740
force-pushed
the
base_ga_sampler
branch
from
January 29, 2025 05:20
93d183c to
da06dc9
Compare
- `get_generation` -> `get_trial_generation` - Remove "current" word from "current generation" because of ambiguity
gen740
force-pushed
the
base_ga_sampler
branch
from
January 29, 2025 05:45
97ccb5c to
0f2dd05
Compare
- Use `get_trials` to preetch all the trials to avoid unnecessary execution of SQL queries - Fix the test of BaseGASampler
gen740
force-pushed
the
base_ga_sampler
branch
from
January 29, 2025 05:46
0f2dd05 to
1522dcd
Compare
Contributor
|
This pull request has not seen any recent activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In optuna GA (Genetic Algorithm) samplers are not easy to implement, this is because each sampler should handle generation id and caches correctly.
So for easy implementation. I implemented the abstract class of the GASampler
BaseGASamplerfor general GA.There are also some bugs in the current implementation.
The nsgaii sampler stopped with a random multiprocess error at this line.
Performance
I created a simple benchmark with the following simple objective function.
Run with in-memory storage and 3000 trials. Repeated 20 times. And the results are as follows
Description of the changes
BaseGASampler.BaseGASampler.