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

Genetic Algorithm is actually Random #12

Open
silvavn opened this issue Sep 12, 2020 · 2 comments
Open

Genetic Algorithm is actually Random #12

silvavn opened this issue Sep 12, 2020 · 2 comments

Comments

@silvavn
Copy link
Contributor

silvavn commented Sep 12, 2020

I went through the Genetic Algorithm Strategy code and it seems to me to be actually random. The purpose of selecting the top K is that we want to preserve their qualities and use them in crossover. However, that preservation does not occur since their are straight crossed. Further, there is no probability involved into mutation.

Point being: The qualities of top k are most likely lost because the code does not preserve them, and does not prioritize them into crossover (we want to reproduce its qualities).

@tradytics
Copy link
Owner

I would respectfully disagree, let's discuss.

So the mutate function takes in the best genes from the previous iteration before mutating them further, here is a screenshot of the code:

https://i.imgur.com/679b2ke.png

Also, this isn't how most of the typical GAs are done so there are definitely some differences in the implementation but the idea of selecting the best and mutating them next thus evolving them in the entire process is still there which is why you see such high gains for GA. If it was random, there would be no gains right?

@silvavn
Copy link
Contributor Author

silvavn commented Sep 12, 2020

I agree with the gains argument. My reasoning is: If I always mutate the top genes, I have the chance of losing the good characteristics from them. It follows that the select function will weed out the ones that perform bad after mutation. However, there is a chance of worsening the entire population because the top genes that were mutated might perform bad. With that i mind, the GA becomes a random walk (of course biased toward the gains xD).

I understand the reasoning I just thought I would raise this, since, by change, someone might get a bad result. Please correct me if I am wrong.

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

No branches or pull requests

2 participants