Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ class GeneticAlgorithm:
|
|
44 |
if len(fitness) > 0:
|
45 |
self.population = [self.population[i] for i in np.argsort(fitness)[-self.population_size//2:]]
|
46 |
def crossover(self):
|
47 |
-
|
48 |
for _ in range(self.population_size//2):
|
49 |
parent1, parent2 = random.sample(self.population, 2)
|
50 |
child = Net()
|
|
|
44 |
if len(fitness) > 0:
|
45 |
self.population = [self.population[i] for i in np.argsort(fitness)[-self.population_size//2:]]
|
46 |
def crossover(self):
|
47 |
+
offspring = []
|
48 |
for _ in range(self.population_size//2):
|
49 |
parent1, parent2 = random.sample(self.population, 2)
|
50 |
child = Net()
|