Genetic Algorithm
function GA(X, Y) do
    population = init()
    n_epochs = N
    for i = 1:N do
         update_fitness(X, Y, population)
         sort(population, on = fitness, order = ascending)
         # retain the best k networks as parents
         # mutate parent weights to create new children
         for j = k+1:length(population) do
              rand = rand(1:k)
              population[j] = mutate_weights(population[rand])
```

```
end
    end
    update_fitness(population)
    sort(population, on = fitness, order = ascending)
    best_entity = population[1]
    return best_entity
end
Appendix A.2. MLP-GD