Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,7 +69,7 @@ class GeneticAlgorithm:
|
|
69 |
self.population += offspring
|
70 |
|
71 |
def mutation(self):
|
72 |
-
|
73 |
if random.random() < 0.1:
|
74 |
weights = net.fc1.get_weights()
|
75 |
new_weights = [np.array(w) + np.random.randn(*w.shape) * 0.1 for w in weights]
|
|
|
69 |
self.population += offspring
|
70 |
|
71 |
def mutation(self):
|
72 |
+
for net in self.population:
|
73 |
if random.random() < 0.1:
|
74 |
weights = net.fc1.get_weights()
|
75 |
new_weights = [np.array(w) + np.random.randn(*w.shape) * 0.1 for w in weights]
|