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

Wrong number of genomes in population. #270

Open
bable631 opened this issue Jul 1, 2023 · 3 comments
Open

Wrong number of genomes in population. #270

bable631 opened this issue Jul 1, 2023 · 3 comments
Assignees

Comments

@bable631
Copy link

bable631 commented Jul 1, 2023

Describe the bug
I set the number of genomes per generation to 250, but 546 were created on the FIRST generation.

To Reproduce
Steps to reproduce the behavior:

  1. Create population with 250 genomes (set in config)
  2. Population has many more genomes than you specified in config.

Expected behavior
There should be exactly 250 genomes. No more, no less.

Desktop (please complete the following information):

  • OS: Windows Server 2012 R2

Additional context
I am running this in python 3.10
I started using this version of NEAT-Python because the regular version that you can install with pip had a similar but different bug that I was trying to avoid. Honestly, this bug seems even worse. That said, if I can't use this code or the other version than I will need to completely redo all of my code with a different neural network algorithm and that's months of work wasted.

@SquarishRectangle
Copy link

I came here to complain about this as well, but this seems to be more of a side effect and not a bug. If your compatibility_threshold is set too low, it will assume each genome in your starting population is an individual species, thus having 250 species in total. By default, each species must have a minimum of 2 members after reproduction, which results in about double the specified population size. This should go away after 15 generations (or whatever you set your max_stagnation to). Generally, I find that this actually results in better evolution since the population is more diverse, but at the same time, the same diversity can be achieved if we simply cut the number of species in half.

There are easy ways to fix this such as increasing your compatibility_threshold or reducing min_species_size among other settings you can tweak, but this behavior really shouldn't be here in the first place.

@bable631
Copy link
Author

bable631 commented Jul 2, 2023 via email

@CodeReclaimers CodeReclaimers self-assigned this Jul 27, 2023
@bable631
Copy link
Author

I'm now having a similar issue that is not being solved by modifying the config: the population is decreasing every generation. I start at 300 population and decrease by about 6 per generation on average. Very weird.

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

3 participants