We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 263cb49 + 03f509f commit 6429accCopy full SHA for 6429acc
pygad/pygad.py
@@ -1710,12 +1710,8 @@ def cal_pop_fitness(self):
1710
# Reaching this block means that batch fitness calculation is used.
1711
1712
# Indices of the solutions to calculate their fitness.
1713
- solutions_indices = numpy.array([
1714
- sol_idx
1715
- for (sol_idx, fitness)
1716
- in enumerate(pop_fitness)
1717
- if fitness is undefined_pop_fitness
1718
- ])
+ solutions_indices = [idx for idx, fit in enumerate(pop_fitness) if type(fit) is str and fit == "undefined"]
+
1719
# Number of batches.
1720
num_batches = int(numpy.ceil(len(solutions_indices) / self.fitness_batch_size))
1721
# For each batch, get its indices and call the fitness function.
0 commit comments