Optimization Module

The optimization module contains evolutionary algorithms and optimization strategies for neural architecture search.

Evolutionary Algorithms

pynas.opt.evo.gene_mutation(children, mutation_probability)[source]

Apply mutation to a list of child chromosomes.

Parameters: children (list): A list of child chromosomes. mutation_probability (float): The probability of a gene mutation.

Returns: list: The mutated child chromosomes.

pynas.opt.evo.single_point_crossover(parents, verbose=False)[source]

Performs a single-point crossover between two parent chromosomes.

Parameters: parents (list): The parent chromosomes as lists of genes.

Returns: list: A list containing two new child chromosomes resulting from the crossover. The crossover point is randomly selected within the range of the shorter chromosome length.

Functions

pynas.opt.evo.single_point_crossover(parents, verbose=False)[source]

Performs a single-point crossover between two parent chromosomes.

Parameters: parents (list): The parent chromosomes as lists of genes.

Returns: list: A list containing two new child chromosomes resulting from the crossover. The crossover point is randomly selected within the range of the shorter chromosome length.

pynas.opt.evo.gene_mutation(children, mutation_probability)[source]

Apply mutation to a list of child chromosomes.

Parameters: children (list): A list of child chromosomes. mutation_probability (float): The probability of a gene mutation.

Returns: list: The mutated child chromosomes.