Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -67,8 +67,8 @@ class GeneticAlgorithm:
|
|
67 |
self.population += offspring
|
68 |
|
69 |
# Get the weights of the parent networks
|
70 |
-
|
71 |
-
|
72 |
# Average the weights of the two parents
|
73 |
child_weights = [(np.array(w1) + np.array(w2)) / 2 for w1, w2 in zip(parent1_weights, parent2_weights)]
|
74 |
child.set_weights(child_weights)
|
|
|
67 |
self.population += offspring
|
68 |
|
69 |
# Get the weights of the parent networks
|
70 |
+
parent1_weights = parent1.get_weights()
|
71 |
+
parent2_weights = parent2.get_weights()
|
72 |
# Average the weights of the two parents
|
73 |
child_weights = [(np.array(w1) + np.array(w2)) / 2 for w1, w2 in zip(parent1_weights, parent2_weights)]
|
74 |
child.set_weights(child_weights)
|