Machine Learning notes - Genetic Algorithms

Evolutionary Algorithms Genetic Algorithms

Evolutionary algorithm Evoluation Algorithms (EAs) has the following three characteristics:

  1. Population-Based: evolutionary optimization algorithm can be described as the process of: generating a relatively good solution set point from the number of the current set of solutions among the relatively poor. The current solution set is called the Population.
  2. Fitness-Oriented: If you now have a lot of solution, and that the quality of the two solutions of how to compare it? Hence the need for a standard to measure the quality of a solution: adaptive function. Adaptive function capable of imparting a degree of adaptation thereof corresponding to each solution.
  3. Variation-Driven: If no suitable solution in the current pululation or not the optimal solution, we wanted to do something in order to get the optimal solution. So it is that every solution must go through some changes, to generate new solutions.

The following describes a specific algorithm: genetic algorithm Genetic Algorithm (GA)

Genetic Algorithms (Genetic Algorithm, GA)

Genetic algorithms are random classical evolutionary algorithm. Here random mean, to use a genetic algorithm to find a solution, we will some random transformation to the current solution, the resulting changes, generate a new solution. Note: Genetic Algorithms (EA) will be called a simple genetic algorithm (Simple Genetic Algorithm, SGA), the reason is that compared to other genetic algorithm is easiest.

Genetic algorithms inspired Darwin's theory of evolution with. This is a slow and gradual process, by making small and slow changes play a role. Therefore, the genetic algorithm is by making small and slow changes to the existing solution, until the best solution.

Principles of genetic algorithms

Genetic Algorithms role of the whole "population" (Population) them in. This "population" contains a number of individuals, each individual is actually a solution (a solution). And each individual has a chromosome . Usually this chromosome is a collection of features which uniquely describes the corresponding individual. At the same time, there are many chromosomal genes. In the computer, we can use many methods to express genes. Below, with 0 and 1 to represent the gene .

Of course, each individual must use a fitness , the fitness is the fitness function is given. It can be used to assess the quality between the two individuals. The higher the fitness, indicating that the more individual fit in the "Environment", then it should be preserved; the lower the fitness, express individual does not fit the "environment", or that the solution is not good enough, then the individual should be eliminated .

We adapt to the relatively high degree of individual placed in a mating pool (mating pool) inside. In the mating pool of individuals called parents . Choose from any of the mating pool out of the two individuals will have a child. By mating two parents of high quality, we expect it will get a higher quality than the children of parents. Of course, if the child arising out of lower fitness than their parents, then the child will be eliminated. Through continuous iteration until the child has had the best fitness or reach a pre-requirements so far.

The current arising out of the child population has some characteristics of their parents. And these children do not change the. And then again when the next generation, the generation may be generated to keep up with the same children, and the fathers of the shortcomings are retained. Therefore, we want children to have them added to the population, or even eliminate their fathers.

The flow chart probably as follows:

Up to this point, in order to fully understand GA algorithm, we have to figure out the following two questions:

  1. How to generate even a child from the parents?
  2. How to slightly modify the child making it a different individual?

The following describes the representation and evolution of chromosomes.

Chromosome representation and evolution

There are many ways of existing in a valid representation of chromosomes. Chromosome representation vary for specific issues. A good representation of the entire search space can be reduced, reducing search time, thereby enhancing the efficiency of the algorithm.

Existing represent chromosomes methods:

  1. Binary (Binary): each chromosome is represented as a string changed to 0 and 1.
  2. Permutation (permutations): This representation is very effective in the face of some of the ordinal problem, such as traveling salesman problem.
  3. The Value (value): put the chromosomally encoded into a specific real number.

For example, we used to represent a binary number 7:

\[0 1 1 1\]

\ (0111 \) is what we call chromosomes, and in which each character is a gene.

Studied high school biology students should know that there are two forms of chromosomes:

  1. Genotype: The set of all genes in the chromosomes that is.
  2. Phenotypes: i.e., physically manifested shape.

In the above example, \ (0111 \) is the genotype, the number 7 is the phenotype.

After realizing the method performance chromosome, which is down to us to see how to calculate each chromosome its fitness value (fitness value)?

Suppose adaptation function (fitness function) is:
\ [F (X) = 2x + 2 \]
where \ (X \) is the chromosome.

So, this chromosome number 7 of its fitness function value is as follows:

\[f(7)=2*7 + 2 = 16\]

Calculation of fitness function is called chromosome evolution (evolution)

initialization

After completion of each individual represents the next step is to choose the number of individuals as a population .

select

Then it is given based on the fitness function, selected individual fitness value is relatively high (higher than the specified value), i.e., selecting some individuals from the population, on the mating pool.

variation

From the mating pool is then selected from the ordered out as two parents individuals (e.g., 1-2, 3-4, etc.). Another method is selected from the two randomly selected each time.

Elected for two parents, the mutation operation. Including two operations:

  1. Cross conversion
  2. mutation

The figure is a schematic cross-converted and mutations:

Cross conversion

Cross conversion of CGA are similar cross conversion on chromosome biology. By splitting a portion of each chromosome fathers brother, and then recombined to form a new chromosome. The number of genes per child from a father get is random. (Because the algorithm described in this article is based on a random evolutionary algorithm is the most simple evolutionary algorithm.). Sometimes, parents chromosomes are split into two portions random position, split, exchange fathers and select the half of the lower half of the chromosome or chromosomes. The end result is a new generation of chromosomes. And this is only one chromosome OFF operation is called a single-point switch (in addition, there are multi-point switch).

mutation

For each child, any changes to some of its genes. Of course, specific to how to change dependent on the form of chromosomes. If the chromosome is represented in binary, then the mutation operation is nothing more than the certain value is changed from 0 to 1 or from 1 into 0. But if the chromosome is represented by a numerical method, then it can only be randomly selected value range.

Quote

https://www.linkedin.com/pulse/introduction-optimization-genetic-algorithm-ahmed-gad/

Guess you like

Origin www.cnblogs.com/shenhaojing/p/11482822.html