Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ class GeneticAlgorithm:
|
|
| 44 |
self.population = [self.population[i] for i in np.argsort(fitness)[-self.population_size//2:]]
|
| 45 |
|
| 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 |
self.population = [self.population[i] for i in np.argsort(fitness)[-self.population_size//2:]]
|
| 45 |
|
| 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()
|