Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elitism not sorted in next generation #251

Merged
merged 1 commit into from
Oct 19, 2020
Merged

Elitism not sorted in next generation #251

merged 1 commit into from
Oct 19, 2020

Conversation

guzuligo
Copy link
Contributor

By adding the elitist at the beginning, next generation will have the best at the beginning instead of being mixed up with the mutated ones.

By adding the elitist at the beginning, next generation will have the best at the beginning instead of being mixed up with the mutated ones.
@christianechevarria
Copy link
Member

Thanks for adding a PR @guzuligo ! 🎆

Would you be able to explain your thinking on the change a bit more?

Elitism selects the best members relative to the previous generation and so there's no guarantee that they will be the best in the current generation which is why they've been added to the end of the members array until now

@guzuligo
Copy link
Contributor Author

Sure.

Have a look at the score. If you have like 5 elitist, you will notice that the fittest elitist is the 5th one.

The problem is when you are monitoring the progress and need to see the fittest one.

For example, I create several rooms where AI tries to do a certain task. If I set the elitism to 1, I just need to monitor the first. If in the middle of the training I decided to change the elitism to 10, I have to move the camera to the 10th to check the progress as the 10th is the one that made better progress in previous generation.

Using unshift simply guarantees that the one with the highest score in previous generation is at index zero, which saves me doing workarounds. 👍

@christianechevarria
Copy link
Member

Makes sense, all tests passed -- merging in!

Thanks again for contirbuting

@christianechevarria christianechevarria merged commit 5106ef6 into liquidcarrot:master Oct 19, 2020
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