-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix evolution tuner RuntimeError and IndexError #2695
Conversation
for item in self.space: | ||
is_rand[item] = True | ||
|
||
config = json2parameter(self.searchspace_json, is_rand, self.random_state) |
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.
Is it possible to generate duplicate parameters?
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.
Yes, the first generation is random generated.
|
||
def trial_end(self, parameter_id, success, **kwargs): | ||
""" | ||
To deal with trial failure. If a trial fails, readd the trial parameters into population. |
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.
"readd"?
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.
I modify the docstring for clarity, please review on the latest version, thanks~
|
||
total_config = config | ||
if not self.population: | ||
self.population.pop(1) |
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.
what if self.population
only has one element?
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.
Thanks~ I have fixed it, please review on the latest version.
@colorjam UT is failed might because |
@colorjam please double check whether the generated configs are the same as the previous implementation when there is no failed trial. |
@QuanluZhang Thanks, I have checked it. I use the previous implementation to generate individuals. |
The current version of evolution tuner has several problems:
trialConcurrency
should be larger thanpopulation_size
, otherwise, the experiment willraise RuntimeError('The population is empty')
.Do not deal with trial failure. If the number of failed trails larger than
population_size
, the experiment willraise RuntimeError('The population is empty')
.The end time of each trial may not be the same, so, the population length maybe 1. It can not make a comparison between two randomly selected individuals.