December 2019
Intermediate to advanced
368 pages
11h 10m
English
The first function evaluates the list of all genomes in the population and assigns a fitness score to each of them. This function is passed by reference into the neuroevolution runner of the NEAT-Python library. The source code of this function is as follows:
def eval_genomes(genomes, config): for genome_id, genome in genomes: genome.fitness = 0.0 net = neat.nn.FeedForwardNetwork.create(genome, config) fitness = cart.eval_fitness(net) if fitness >= config.fitness_threshold: # do additional steps of evaluation with random initial states # to make sure that we found stable control strategy rather # than special case for particular initial state success_runs = evaluate_best_net(net, ...
Read now
Unlock full access