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.
1 parent 1f067d1 commit 03f509fCopy full SHA for 03f509f
pygad/pygad.py
@@ -1708,8 +1708,7 @@ def cal_pop_fitness(self):
1708
# Reaching this block means that batch fitness calculation is used.
1709
1710
# Indices of the solutions to calculate their fitness.
1711
- solutions_indices = numpy.where(
1712
- numpy.array(pop_fitness) == "undefined")[0]
+ solutions_indices = [idx for idx, fit in enumerate(pop_fitness) if type(fit) is str and fit == "undefined"]
1713
# Number of batches.
1714
num_batches = int(numpy.ceil(len(solutions_indices) / self.fitness_batch_size))
1715
# For each batch, get its indices and call the fitness function.
0 commit comments