added two new evolutionary strategies#181
added two new evolutionary strategies#181giovanni-merlin wants to merge 1 commit intomichaelhush:masterfrom
Conversation
|
Hi, I found it useful for my project to implement these two modification of standard evolutionary strategies, I thought others might find that useful too |
zakv
left a comment
There was a problem hiding this comment.
Hello, and thanks for contributing to M-LOOP!
The implementation looks great. The only changes I'll request are related to documentation - it's important that users know that these new options exist and it's important to make the code easy to understand for experts/developers. I've added a couple comments here to help with that.
Additionally, you'll see that the available options for evolution_strategy are listed in examples/differential_evolution_complete_config.txt and in the docstring of the DifferentialEvolutionLearner class. Could you please add your two new options to the lists in those two locations as well?
| r0, r1, r2, r3, r4 = self.random_index_sample(index, 5) | ||
| return self.population[r0] + self.curr_scale * (self.population[r1] + self.population[r2] - self.population[r3] - self.population[r4]) | ||
|
|
||
| # custom evolutionary strategy |
There was a problem hiding this comment.
We can delete this line since (assuming this PR is merged) these won't be custom any more!
| # custom evolutionary strategy |
| return self.population[r0] + self.curr_scale * (self.population[r1] + self.population[r2] - self.population[r3] - self.population[r4]) | ||
|
|
||
| # custom evolutionary strategy | ||
| # may need to add a separate scaling factor |
There was a problem hiding this comment.
Let's update the docstring to mention this instead of noting this in a comment. We should also try to make it easier to understand without much further reading. So the docstring should mention something along the lines of how we currently use the same scaling factor for "the vector from the current parameters to the best parameters" and "the vector(s) between other random population members" even though those could be different.
No description provided.