Skip to content

added two new evolutionary strategies#181

Open
giovanni-merlin wants to merge 1 commit into
michaelhush:masterfrom
giovanni-merlin:master
Open

added two new evolutionary strategies#181
giovanni-merlin wants to merge 1 commit into
michaelhush:masterfrom
giovanni-merlin:master

Conversation

@giovanni-merlin

Copy link
Copy Markdown

No description provided.

@giovanni-merlin

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

@zakv zakv left a comment

Copy link
Copy Markdown
Collaborator

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?

Comment thread mloop/learners.py
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
Copy Markdown
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

Comment thread mloop/learners.py
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
Copy Markdown
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.

Comment thread mloop/learners.py
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