What is a genetic/evolutionary algorithm?

Source: Internet
Author: User
Tags knowledge base

This is a very special machine learning technique inspired by the theory of Evolution .  I've come to understand recently that it may be the key to cracking strong AI.  Ben Goertzel also paid special attention to this direction in his conversation with me. It turned out that Alan Turing had long seen the obvious relationship between evolution and machine learning, and that now a well-known researcher Leslie Valiant, a computer study, also talked about the subject in the new book (English version).

Evolution

First, to understand what evolution is.  Suppose, for example, that an animal's genetic mutation makes it sharper than his companion's claws and teeth, then it can eat food that his companions cannot eat, and can grab more heterosexual mates.  Long, its companions will be less descendants, even extinct, and its descendants will become more and more powerful. This is the survival of the fittest.

The human condition is somewhat different, because human beings have culture (meaning that knowledge is taught by language), so some of the advantages are not purely genetic.  The issue is controversial because it involves moral issues such as eugenics.  People like to cite counter-examples, such as saying, "This man does not grow well, but has many girlfriends" and so on, I do not want to pull too far. Think of the strongest emotions of human beings, who cannot find a partner to breed, and we will be miserable without the favor of the opposite sex, or see others with more "resources resource" will envy, these are very powerful evidence of evolution. " Human emotions can often be explained by evolution, the subject called Evolutionary psychology (evolutionary psychology).

I personally believe that competition is the basic condition of the biological and human society, and we must accept it and get used to it.   Humans are also competing in business, war, sports, literature, and even chess. "It is a good encouragement to be a gentleman to self-improvement".

Evolutionary learning

As previously said, the purpose of machine learning is to look for those statements that interpret reality correctly in the vast hypothetical space (hypothesis spaces). For example, a baby may use "beard is Dad" to explain the presence of people around.

The problem is that assuming the space is too large, we are like "looking for a needle in a straw push", and brute force alone is not the way.

Evolutionary algorithms are a strong technique for finding the best Answer in a large space (optimal solution). It simulates the candidates that need to be looked into as a "population"population, allowing these candidates to compete in an artificial environment, and then selecting a handful of samples with the highest scores each time to "mate", that is, the genetic recombination ( Genetic recombination), so that the emergence of a new batch of candidates, so gradually pushed to more and more excellent solutions.

For example, researchers have evolved some electronic circuitry using evolutionary algorithms, such as a sound filter (filter), whose performance is even better than hand-designed.  Moreover, the circuit is very irregular and difficult to understand, people do not know how it works, and some parts even have more than the existence of components. That's because evolutionary processes, sometimes seemingly useless "organs" may become useful after the combination, so evolutionary results often retain a lot of "waste junk". "

I just want to use this method to write Genifer's learning function (the candidates that we want to evolve are logic formulas).

Algorithm

What is the specific algorithm?

    1. Initially, a population is prepared, which can be generated randomly.
    2. The value of each candidate (evaluation) is to allow this candidate to survive in the artificial world.  For example we test how it behaves in the desired function. The method of scoring is called objective function "purpose functions".
    3. Select the best performing N candidates, and make variant mutation or recombinant recombination.  Variants are acting on a single candidate, and recombination requires a pair of candidates.  That involves how we represent the elements of the design space as "genes", which is the problem of so-called representations (representation). The code is designed by researchers.
    4. At the time of grading, we can allow those candidates to cooperate with each other in the environment and compete at the same time, that is called cooperative evolution. I think genifer need to use this method, because each knowledge fragment in the knowledge base is to interact with other knowledge, the logical system can deduce the interesting result.

This book (the author's website for free Online reading) introduces several "nature-inspired" algorithms in a comprehensible way:

The genetic algorithm, for example, is written in Ruby in just a single page.

Practice

The example is called "Onemax", each individual is a string of 0 and 1 strings, and the goal is to all become "1".

This example is particularly simple, because "gene" is the individual's explicit (phenotype), omitting the genetic expression (gene expression) This step, to learn.

When actually running, something interesting happens. I tried Ruby first and then translated it into Scala, but strangely the Scala version didn't converge to the perfect result, and the Ruby version was quickly reached.

I've shown the two populations of Ruby and Scala as images, each Heng lie an individual. The first fragment is the evolution of ruby"normal" (the first Perfect pure "1" individual has evolved at the end):

And the second one is I wrote scala"" Evolution:

Visible in the pathological version, the children gradually become the same, and each has the same defect (thus shown as a vertical line).

Why is it? Debug for a full two days, only to find a 0 writing 1 error, so that point mutation function is not the same, that is to say that the pathological version of the lack of mutations.

That is a very enlightening bug, so I learned that alone sexual reproduction can not achieve efficient evolution, the original point mutations also have a key importance, and I have been mistaken for sexual reproduction is to produce  the only way to diversify (diversity).  I vaguely remember mentioning this in the literature, but I don't remember.  Is it funny? :)

What is a genetic/evolutionary algorithm?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.