GeneticSearch operates on generations of candidate solutions. Each generation consists of multiple candidate solutions. Before a new generation can be generated all candidates of the current one are assigned a fitness value (1 / runtime (in us) in our case).
The top candidates are preserved intact across generation (elitism).
Each new candidate is generated with the following two mechanisms:
crossover: 3 parent candidates are selected probabilistically (influenced by their fitness, the higher it is the higher the chance of selection) and merged into a new candidate
mutation: parts of a candidate are randomly changed (mutated)
The crossover rate controls how many candidates survive across generations and how many new candidates are produced through crossover, e.g, 80% crossover rate would result in roughly 20% of the new generation to consist of candidates that survived from the previous one. Note, that this is different from elitism: elite candidates are not mutated but "survivors" are.
The mutation rate controls the probability with which mutation occurs.
tc::autotune::GeneticSearch::GeneticSearch |
( |
const TuningConfiguration & |
conf, |
|
|
size_t |
n, |
|
|
uint8_t |
crossOverRate, |
|
|
uint8_t |
mutationRate, |
|
|
size_t |
numberElites |
|
) |
| |
conf is used to determine which are the tunable parameters, the selected values in conf are ignored and the population is randomized
n is the population size
crossoverRate is the probability ([0,100]) that a new candidate is produced through reproduction
mutationRate is the probability ([0,100]) that parameters are mutated (randomly changed) whenever a new generation is created
numberElites best candidates are preserved across generations (elitism), number Elites must be less than n
tc::autotune::GeneticSearch::GeneticSearch |
( |
const std::vector< TuningConfiguration > & |
confs, |
|
|
size_t |
n, |
|
|
uint8_t |
crossOverRate, |
|
|
uint8_t |
mutationRate, |
|
|
size_t |
numberElites |
|
) |
| |
confs are used to seed the first generation, the rest of the population is randomly initialized
n is the population size
crossoverRate is the probability ([0,100]) that a new candidate is produced through reproduction
mutationRate is the probability ([0,100]) that parameters are mutated (randomly changed) whenever a new generation is created
numberElites best candidates are preserved across generations (elitism), number Elites must be less than n