Skip to content

Conversation

giovanni-merlin
Copy link

No description provided.

@giovanni-merlin
Copy link
Author

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

Copy link
Collaborator

@zakv zakv left a comment

Choose a reason for hiding this comment

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

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can delete this line since (assuming this PR is merged) these won't be custom any more!

Suggested change
# 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

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.

2 participants