Proposed genome for creating VHDL programs with genetic algorithms

37
Genetic Algorithms George Bora UTCN April 13, 2014 George Bora (UTCN) Genetic Algorithms April 13, 2014 1 / 17

Transcript of Proposed genome for creating VHDL programs with genetic algorithms

Genetic Algorithms

George Bora

UTCN

April 13, 2014

George Bora (UTCN) Genetic Algorithms April 13, 2014 1 / 17

Computer Science to Evolutionary Computation

Within the vast field of computer science under it’s vast array of potentialapplications there exists the branch of artificial intelligence.

One of the sub-branches of artificial intelligence is evolutionarycomputation which seeks to achieve continuous optimization andcombinatorial optimization by incorporating knowledge of natural evolutionprocesses.

George Bora (UTCN) Genetic Algorithms April 13, 2014 2 / 17

Computer Science to Evolutionary Computation

Within the vast field of computer science under it’s vast array of potentialapplications there exists the branch of artificial intelligence.

One of the sub-branches of artificial intelligence is evolutionarycomputation which seeks to achieve continuous optimization andcombinatorial optimization by incorporating knowledge of natural evolutionprocesses.

George Bora (UTCN) Genetic Algorithms April 13, 2014 2 / 17

Basic Concepts from Biology

The basic building blocks for evolutionary computation, which have kepttheir names from their native science, are as follows:

genes

allele

chromosome

individual

mapping

mutation and crossover

fitness function

George Bora (UTCN) Genetic Algorithms April 13, 2014 3 / 17

Genes

The element from which this method derives it name, as genes are thebasic building blocks of life.

So too in our search for the solution for various problems, genes are thebasic elements we switch around and juggle with in order to arrive at amore optimum solution.

George Bora (UTCN) Genetic Algorithms April 13, 2014 4 / 17

Genes

The element from which this method derives it name, as genes are thebasic building blocks of life.

So too in our search for the solution for various problems, genes are thebasic elements we switch around and juggle with in order to arrive at amore optimum solution.

George Bora (UTCN) Genetic Algorithms April 13, 2014 4 / 17

Allele

If genes are the basics of the solution in theory, alleles are the valuesencoded in genes are the ones we use in practice, when developingsoftware which uses genetic programming.

When the time has passed and the solution must effectively be built orinstantiated it is the allele which forms the blue print we go by.

In the original vision for genetic algorithms there was only 1 allele pergene, which was a binary value and was stored in a 1 bit, as the fieldprogressed all of those constrictions have been lifted.

George Bora (UTCN) Genetic Algorithms April 13, 2014 5 / 17

Allele

If genes are the basics of the solution in theory, alleles are the valuesencoded in genes are the ones we use in practice, when developingsoftware which uses genetic programming.

When the time has passed and the solution must effectively be built orinstantiated it is the allele which forms the blue print we go by.

In the original vision for genetic algorithms there was only 1 allele pergene, which was a binary value and was stored in a 1 bit, as the fieldprogressed all of those constrictions have been lifted.

George Bora (UTCN) Genetic Algorithms April 13, 2014 5 / 17

Allele

If genes are the basics of the solution in theory, alleles are the valuesencoded in genes are the ones we use in practice, when developingsoftware which uses genetic programming.

When the time has passed and the solution must effectively be built orinstantiated it is the allele which forms the blue print we go by.

In the original vision for genetic algorithms there was only 1 allele pergene, which was a binary value and was stored in a 1 bit, as the fieldprogressed all of those constrictions have been lifted.

George Bora (UTCN) Genetic Algorithms April 13, 2014 5 / 17

Chromosome and Individual

As in nature an animal can not have it’s information encoded in a singlegene, in programming a solution which warrants genetic algorithms is notsimple enough as to be composed on 1 gene.

Chromosomes are the collection of genes, which make up the blueprintfrom which we will map our solution and create the individual.

If the chromosomes are the blue prints the individual is the ”end product”,to make an analogy with software engineering, and individual is to a classwhat a instance is to a object.

George Bora (UTCN) Genetic Algorithms April 13, 2014 6 / 17

Chromosome and Individual

As in nature an animal can not have it’s information encoded in a singlegene, in programming a solution which warrants genetic algorithms is notsimple enough as to be composed on 1 gene.

Chromosomes are the collection of genes, which make up the blueprintfrom which we will map our solution and create the individual.

If the chromosomes are the blue prints the individual is the ”end product”,to make an analogy with software engineering, and individual is to a classwhat a instance is to a object.

George Bora (UTCN) Genetic Algorithms April 13, 2014 6 / 17

Chromosome and Individual

As in nature an animal can not have it’s information encoded in a singlegene, in programming a solution which warrants genetic algorithms is notsimple enough as to be composed on 1 gene.

Chromosomes are the collection of genes, which make up the blueprintfrom which we will map our solution and create the individual.

If the chromosomes are the blue prints the individual is the ”end product”,to make an analogy with software engineering, and individual is to a classwhat a instance is to a object.

George Bora (UTCN) Genetic Algorithms April 13, 2014 6 / 17

Mapping

The process by which we construct a individual from the chromosome wehave generated is called mapping, it is one of the important elements(alongside chromosome structure and fitness functions) we must considerbefore we implement our design.

Mapping and it’s complexity is often tied

with how we define our alleles,genes and chromosome as well as ourgenetic operations, a great deal of planning being required in order toproduce the best possible algorithm.

George Bora (UTCN) Genetic Algorithms April 13, 2014 7 / 17

Mapping

The process by which we construct a individual from the chromosome wehave generated is called mapping, it is one of the important elements(alongside chromosome structure and fitness functions) we must considerbefore we implement our design. Mapping and it’s complexity is often tied

with how we define our alleles,genes and chromosome as well as ourgenetic operations, a great deal of planning being required in order toproduce the best possible algorithm.

George Bora (UTCN) Genetic Algorithms April 13, 2014 7 / 17

Crossover

Crossover is one of the fundamental operations within the toolbox ofgenetic algorithms, and one of the most important methods by which wecan combine existing chromosomes to form new ones in the search for afit enough solution.

It involves separating each chromosome which takes

part into two parts, and then recombining parts from the different oldchromosomes to form the new set of chromosomes.

George Bora (UTCN) Genetic Algorithms April 13, 2014 8 / 17

Crossover

Crossover is one of the fundamental operations within the toolbox ofgenetic algorithms, and one of the most important methods by which wecan combine existing chromosomes to form new ones in the search for afit enough solution. It involves separating each chromosome which takes

part into two parts, and then recombining parts from the different oldchromosomes to form the new set of chromosomes.

George Bora (UTCN) Genetic Algorithms April 13, 2014 8 / 17

Mutation

Mutation is the changing of the allele of a gene to another one of it’spossible values.

This operation permits genetic algorithms to potentially

escape from local optimum solutions, a very important characteristic in thefield of artificial intelligence.

George Bora (UTCN) Genetic Algorithms April 13, 2014 9 / 17

Mutation

Mutation is the changing of the allele of a gene to another one of it’spossible values. This operation permits genetic algorithms to potentially

escape from local optimum solutions, a very important characteristic in thefield of artificial intelligence.

George Bora (UTCN) Genetic Algorithms April 13, 2014 9 / 17

Fitness Function

Via crossover and mutation we can create whole populations ofindividuals, potential solutions, and so the question arises when do westop the evolutionary cycle?

The answer being when we have reached a

certain vicinity of an ideal solution, but for this we need to evaluate howclose is any one individual to satisfying our demands and being the soughtafter solution.

George Bora (UTCN) Genetic Algorithms April 13, 2014 10 / 17

Fitness Function

Via crossover and mutation we can create whole populations ofindividuals, potential solutions, and so the question arises when do westop the evolutionary cycle? The answer being when we have reached a

certain vicinity of an ideal solution, but for this we need to evaluate howclose is any one individual to satisfying our demands and being the soughtafter solution.

George Bora (UTCN) Genetic Algorithms April 13, 2014 10 / 17

Fitness Function II

The implementation of the fitness function changes from one class ofproblems to another, standardization being much more difficult than withgenes, and is one of the most time consuming elements of geneticprogramming.

Writing the fitness function, which when given a chromosome will returnhow fit or close to the ideal it is, is one of the hardest yet essential tasks indeveloping a solution with genetic programming as it is the only way toclose the loop and choose a final solution.

George Bora (UTCN) Genetic Algorithms April 13, 2014 11 / 17

Fitness Function II

The implementation of the fitness function changes from one class ofproblems to another, standardization being much more difficult than withgenes, and is one of the most time consuming elements of geneticprogramming.

Writing the fitness function, which when given a chromosome will returnhow fit or close to the ideal it is, is one of the hardest yet essential tasks indeveloping a solution with genetic programming as it is the only way toclose the loop and choose a final solution.

George Bora (UTCN) Genetic Algorithms April 13, 2014 11 / 17

Genetic Algorithms vs Genetic Programming

Within this field there exist two very different paradigms, geneticalgorithms and genetic programming the most visible difference betweenthem being the structure of the chromosomes they produce.

Genetic algorithms work with a chromosome which is linear and often fixedin length, making them ideal for tunning the behavior of various solutions.

Genetic programming instead uses a tree-structured chromosome variablein size, which allows it to generate the structure of the solution as well asthe behaviour.

George Bora (UTCN) Genetic Algorithms April 13, 2014 12 / 17

Genetic Algorithms vs Genetic Programming

Within this field there exist two very different paradigms, geneticalgorithms and genetic programming the most visible difference betweenthem being the structure of the chromosomes they produce.

Genetic algorithms work with a chromosome which is linear and often fixedin length, making them ideal for tunning the behavior of various solutions.

Genetic programming instead uses a tree-structured chromosome variablein size, which allows it to generate the structure of the solution as well asthe behaviour.

George Bora (UTCN) Genetic Algorithms April 13, 2014 12 / 17

Genetic Algorithms vs Genetic Programming

Within this field there exist two very different paradigms, geneticalgorithms and genetic programming the most visible difference betweenthem being the structure of the chromosomes they produce.

Genetic algorithms work with a chromosome which is linear and often fixedin length, making them ideal for tunning the behavior of various solutions.

Genetic programming instead uses a tree-structured chromosome variablein size, which allows it to generate the structure of the solution as well asthe behaviour.

George Bora (UTCN) Genetic Algorithms April 13, 2014 12 / 17

The problem

Automatically generate a VHDL program for simple signal processing.

Our solution, create a chromosome structure, crossover and relatedoperations as well as a fitness fitness which will write the program for us.

George Bora (UTCN) Genetic Algorithms April 13, 2014 13 / 17

The problem

Automatically generate a VHDL program for simple signal processing.

Our solution, create a chromosome structure, crossover and relatedoperations as well as a fitness fitness which will write the program for us.

George Bora (UTCN) Genetic Algorithms April 13, 2014 13 / 17

The problem

Automatically generate a VHDL program for simple signal processing.

Our solution, create a chromosome structure, crossover and relatedoperations as well as a fitness fitness which will write the program for us.

George Bora (UTCN) Genetic Algorithms April 13, 2014 13 / 17

VHDL

VHDL is a hardware description language used in electronic designautomation to describe digital and mixed signal systems, it is most oftenused with FPGA and integrated circuits.

Initially it was designed for simulation of electronic designs but it sooncame to be used as well for implementing those designs in FPGA andASIC.

Another possible use of VHDL, which we will not use in this presentation,is as a general purpose parallel programming language.?

George Bora (UTCN) Genetic Algorithms April 13, 2014 14 / 17

VHDL

VHDL is a hardware description language used in electronic designautomation to describe digital and mixed signal systems, it is most oftenused with FPGA and integrated circuits.

Initially it was designed for simulation of electronic designs but it sooncame to be used as well for implementing those designs in FPGA andASIC.

Another possible use of VHDL, which we will not use in this presentation,is as a general purpose parallel programming language.?

George Bora (UTCN) Genetic Algorithms April 13, 2014 14 / 17

VHDL

VHDL is a hardware description language used in electronic designautomation to describe digital and mixed signal systems, it is most oftenused with FPGA and integrated circuits.

Initially it was designed for simulation of electronic designs but it sooncame to be used as well for implementing those designs in FPGA andASIC.

Another possible use of VHDL, which we will not use in this presentation,is as a general purpose parallel programming language.?

George Bora (UTCN) Genetic Algorithms April 13, 2014 14 / 17

VHDL Designs

A design, the primary goal of VHDL, will always be formed out of two parts:

The entity, or structure which contains the input ports as well as the outputports.

The architecture in which the behavior of the design is described by usingVHDL’s operators.

George Bora (UTCN) Genetic Algorithms April 13, 2014 15 / 17

VHDL Designs

A design, the primary goal of VHDL, will always be formed out of two parts:

The entity, or structure which contains the input ports as well as the outputports.

The architecture in which the behavior of the design is described by usingVHDL’s operators.

George Bora (UTCN) Genetic Algorithms April 13, 2014 15 / 17

VHDL Designs

A design, the primary goal of VHDL, will always be formed out of two parts:

The entity, or structure which contains the input ports as well as the outputports.

The architecture in which the behavior of the design is described by usingVHDL’s operators.

George Bora (UTCN) Genetic Algorithms April 13, 2014 15 / 17

A possible implementation

For a possible implementation we can start from these basics:

genes and alleles :: either the ports, as leafs, or the operations ofVHDL, as nodes.

chromosome :: the entity combined with the architecture thus thesought after design.

mapping :: loading the design into a VHDL simulator and later onstandard VHDL mapping

fitness function :: the performance of the chromosomes design in aBHDL simulator

George Bora (UTCN) Genetic Algorithms April 13, 2014 16 / 17

The End

Thank your for your attention !

Any questions ?

George Bora (UTCN) Genetic Algorithms April 13, 2014 17 / 17

The End

Thank your for your attention !

Any questions ?

George Bora (UTCN) Genetic Algorithms April 13, 2014 17 / 17