input: Write a python function to run a genetic algorithm to optimize a neural network. 
  assert genetic_algorithm(50, 20)[0] == 50
  assert genetic_algorithm(50, 20)[1] == 20
output: import random
  
  def genetic_algorithm(population_size, generations):
      def create_individual():
          return [random.uniform(-1, 1) for _ in range(10)]
  
      def create_population(size):
          return [create_individual() for _ in range(size)]
  
      def fitness(individual):
          return sum(individual)  # Dummy fitness function
  
      def selection(population):
          population.sort(key=fitness, reverse=True)
          return population[:len(population) // 2]
  
      def crossover(parent1, parent2):
          crossover_point = random.randint(1, len(parent1) - 1)
          child1 = parent1[:crossover_point] + parent2[crossover_point:]
          child2 = parent2[:crossover_point] + parent1[crossover_point:]
          return child1, child2
  
      def mutate(individual, mutation_rate=0.01):
          for i in range(len(individual)):
              if random.random() < mutation_rate:
                  individual[i] = random.uniform(-1, 1)
  
      population = create_population(population_size)
      
      for generation in range(generations):
          selected = selection(population)
          next_generation = []
  
          while len(next_generation) < population_size:
              parent1, parent2 = random.sample(selected, 2)
              child1, child2 = crossover(parent1, parent2)
              mutate(child1)
              mutate(child2)
              next_generation.extend([child1, child2])
  
          population = next_generation[:population_size]
      
      return (population_size, generations)