Sephfox commited on
Commit
e15c18a
·
verified ·
1 Parent(s): 2537fdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -70,9 +70,9 @@ class GeneticAlgorithm:
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)
75
- offspring.append(child)
76
  self.population += offspring
77
 
78
  def mutation(self):
 
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)
75
+ offspring.append(child)
76
  self.population += offspring
77
 
78
  def mutation(self):