pyneat.stagnation module¶
Track the progress of species and remove those that have stalled.
TODO: Add stagnation tests. TODO: Update module docstrings, and clean up comments and code.
-
class
pyneat.stagnation.
Stagnation
(config, reporters)[source]¶ Bases:
neat.config.DefaultClassConfig
Track the progress of species and remove those that have stalled.
-
classmethod
parse_config
(param_dict)[source]¶ Parses the stagnation configuration parameters.
- Config Parameters:
- species_fitness_func (str): The function (mean, max) for
- aggregating the fitnesses of the members of each species.
- max_stagnation (int): The maximum number of generations a
- species can stall for before being deemed stagnant.
- species_elitism (int): The minimum number of species that should
- be retained.
TODO: Refactor species_elitism as min_species
Parameters: param_dict – …
Returns: … Return type: DefaultClassConfig
-
update
(species_set, generation)[source]¶ Required interface method. Updates species fitness history information, checking for ones that have not improved in max_stagnation generations, and - unless it would result in the number of species dropping below the configured species_elitism parameter if they were removed, in which case the highest-fitness species are spared - returns a list with stagnant species marked for removal.
Parameters: - species_set –
…
- generation –
…
Returns: …
Return type: - species_set –
-
classmethod