FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-04-2005, 04:05 AM
Guest
 
Posts: n/a
Default Where can i find GeneticFPGA toolkit

Hello Everyone
I am a final year student at Manukau Institute of Technology.I am doing
my honours research project on Evolvable Harwdware. Xilinx has
developed GeneticFPGA toolkit. On one of the FPGA newsgroups I read
that it is free for download once you send a request email to the
address [email protected]. I couldn't find it on the Xilinx website.Also
I did send an email on this jbits address a few times but did not get
any reply.
I would be really grateful if you could send me the link to download
GeneticFPGA toolkit.
Thank you
Ankit Parikh

Reply With Quote
  #2 (permalink)  
Old 08-04-2005, 06:11 AM
Antti Lukats
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit


<[email protected]> schrieb im Newsbeitrag
news:[email protected] oups.com...
> Hello Everyone
> I am a final year student at Manukau Institute of Technology.I am doing
> my honours research project on Evolvable Harwdware. Xilinx has
> developed GeneticFPGA toolkit. On one of the FPGA newsgroups I read
> that it is free for download once you send a request email to the
> address [email protected]. I couldn't find it on the Xilinx website.Also
> I did send an email on this jbits address a few times but did not get
> any reply.
> I would be really grateful if you could send me the link to download
> GeneticFPGA toolkit.
> Thank you
> Ankit Parikh
>


NOWHERE.

if you search with Google you only find references to year 1999 !
so its possible as dead as JBits and no chanc to get hold on it.

Antti


Reply With Quote
  #3 (permalink)  
Old 08-04-2005, 06:50 AM
Peter Alfke
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Ankit,
click on
http://en.wikipedia.org/wiki/Evolvable_hardware
and google Adrian Thompson.
The Xilinx devices he used, the 6200 family, is dead. No hardware, no
software.
The family dies for lack of commercial interest.
My feeling is that some smart academics have explored this field
already, and I have seen no progress over the past 5 years.
I would pick another subject...
Peter Alfke

Reply With Quote
  #4 (permalink)  
Old 08-04-2005, 01:08 PM
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Hi Peter
I am half way through this topic.So I have to finish it up.
Have you read Adrian Thompson's PHD thesis.I guess it would contain
some valuable information.Do you know where I could get it.Or do you
have any other suggestions for me.
Thanks
Ankit




Peter Alfke wrote:
> Ankit,
> click on
> http://en.wikipedia.org/wiki/Evolvable_hardware
> and google Adrian Thompson.
> The Xilinx devices he used, the 6200 family, is dead. No hardware, no
> software.
> The family dies for lack of commercial interest.
> My feeling is that some smart academics have explored this field
> already, and I have seen no progress over the past 5 years.
> I would pick another subject...
> Peter Alfke


Reply With Quote
  #5 (permalink)  
Old 08-04-2005, 03:52 PM
Peter Alfke
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Ankit,
I am the wrong person to ask, for I, personally, find the whole subject
bogus.
But that's my problem...
Peter Alfke

Reply With Quote
  #6 (permalink)  
Old 08-04-2005, 06:57 PM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Evolutionary Algorithms do have their place.

During my Masters program a friend and I wrote a piece of software that
would take a logic circuit and generate a set of test vectors that
would give you the best fault coverage.

The program did this using a "Genetic Algorithm" approach.
First a random set of test vectors were created. Then the set of
vectors were repopulated based on a fitness function. (Basically if the
test vector had a high % of fault coverage it was more likely to be
selected back in the set of vectors) After that there is a
mutation/cross over phase which adds more variants to the population.
These 3 steps are repeated until a certain % of fault coverage is
completed by a set of the vectors.

The upside to this approach is it can be a lot faster than an
exhaustive approach, especially if the circuit is large. The downside
is every time you run the program you get a different answer. The
whole value of this and other evolutionary methods are how good is the
fitness function.

I'm not sure how you would use evolutionary methods in an FPGA.
Unless you wanted a hardware version of what my program does... create
a set of test vectors to test your ASIC every time it boots up. But I
probably need to read Adrian's paper aswell.

It is an interesting topic even if it might only academic merit at the
present.

Here are the references for the paper I wrote on this program.

1) Rudnick, E. , "Application of Simple Genetic Algorithms to
Sequential Circuit Test
Generation", Center for Reliable and High-Performance Computing,
University of
Illinois, Urbana, Il 61801
2) Rudnick, E., "Sequential Circuit Test Generation in a Genetic
Algorithm Framework",
Center for Reliable and High-Performance Computing, University of

Illinois, Urbana, Il 61801
3) Corno, F., "A Parallel Genetic Algorithm for Automatic Generation
of Test Sequences
for Digital Circuits", Dip. Automatica e Informatica -
Politecnico di Torino, Torino
Italy
4) Prinetto, P., "An Automatic Test Pattern Generator for Large
Sequential Circuits
based on Genetic Algorithms", Dip. Automatica e Informatica -
Politecnico di Torino,
Torino Italy

Eric Holland

Reply With Quote
  #7 (permalink)  
Old 08-04-2005, 07:31 PM
Peter Alfke
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

I should have been more specific:
I can imagine creative and useful ways to write software, and test
vectors, i.e. zeros and ones in an evolutionary way.
I just have a hard time with evolutionary hardware, where Adrian
created a frequency discriminator that worked, but defied any method of
circuit analysis (and repeatability, and stability over temperature).
Peter Alfke (just my personal opnion).

Reply With Quote
  #8 (permalink)  
Old 08-06-2005, 04:01 AM
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Hello Everyone
Thanks Eric for the suggestions.Since you have been working in the area
of evolutionary algorithms, can you suggest where I could find some
examples of code that use evolutionary algorithms for electronic or
logic circuit.This would give me an idea to start with my own code.I
haven't actually seen an evolutionary algorithm being implemented in a
code.So I have absolutely no idea how it looks like.Its like learning
programming for the first time.You need to look at some programs to get
started with your own code.
Ankit




Eric wrote:
> Evolutionary Algorithms do have their place.
>
> During my Masters program a friend and I wrote a piece of software that
> would take a logic circuit and generate a set of test vectors that
> would give you the best fault coverage.
>
> The program did this using a "Genetic Algorithm" approach.
> First a random set of test vectors were created. Then the set of
> vectors were repopulated based on a fitness function. (Basically if the
> test vector had a high % of fault coverage it was more likely to be
> selected back in the set of vectors) After that there is a
> mutation/cross over phase which adds more variants to the population.
> These 3 steps are repeated until a certain % of fault coverage is
> completed by a set of the vectors.
>
> The upside to this approach is it can be a lot faster than an
> exhaustive approach, especially if the circuit is large. The downside
> is every time you run the program you get a different answer. The
> whole value of this and other evolutionary methods are how good is the
> fitness function.
>
> I'm not sure how you would use evolutionary methods in an FPGA.
> Unless you wanted a hardware version of what my program does... create
> a set of test vectors to test your ASIC every time it boots up. But I
> probably need to read Adrian's paper aswell.
>
> It is an interesting topic even if it might only academic merit at the
> present.
>
> Here are the references for the paper I wrote on this program.
>
> 1) Rudnick, E. , "Application of Simple Genetic Algorithms to
> Sequential Circuit Test
> Generation", Center for Reliable and High-Performance Computing,
> University of
> Illinois, Urbana, Il 61801
> 2) Rudnick, E., "Sequential Circuit Test Generation in a Genetic
> Algorithm Framework",
> Center for Reliable and High-Performance Computing, University of
>
> Illinois, Urbana, Il 61801
> 3) Corno, F., "A Parallel Genetic Algorithm for Automatic Generation
> of Test Sequences
> for Digital Circuits", Dip. Automatica e Informatica -
> Politecnico di Torino, Torino
> Italy
> 4) Prinetto, P., "An Automatic Test Pattern Generator for Large
> Sequential Circuits
> based on Genetic Algorithms", Dip. Automatica e Informatica -
> Politecnico di Torino,
> Torino Italy
>
> Eric Holland


Reply With Quote
  #9 (permalink)  
Old 08-06-2005, 05:51 AM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Genetic Algorithm pseudo code:

Problem: Solve 2x+1 = 7 (we know the answer is 3, but work with me)

Step #1 Generate a Random population of numbers:

Population = 1, 6, 8, 4

Step #2 Chose a fitness function. Ours will be Error = ABS(1-(2x +
1)/7)

Error(1) = ABS(1-(2x1+1/7)) = 0.57
Error(6) = ABS(1-(2x6+1/7)) = 0.86
Error(8) = ABS(1-(2x8+1/7)) = 1.43
Error(4) = ABS(1-(2x4+1/7)) = 0.29

The number with the smallest Error is closest to the answer. (Still
with me?)

Step #3 Repopulate your population based on your fitness function
results. This is the tough part to grasp. We need to normalize all of
the errors so we can get a repopulation percentage. This will help us
get the new population of numbers.

Take the total of the error 0.57 + 0.86 + 1.43 + 0.29 = 3.15

3.15/0.57 = 5.53
3.15/0.86 = 3.66
3.15/1.43 = 2.20
3.15/0.29 = 10.86

Take the total of the normalized error = 5.53 + 3.66 + 2.20 + 10.86
=22.25

Repopulation percentage for 1 = 5.53/22.25 = 25%
Repopulation percentage for 6 = 3.66/22.25 = 16%
Repopulation percentage for 8 = 2.20/22.25 = 10%
Repopulation percentage for 4 = 10.86/22.25 = 49 %

So now you repopulation your population, this means if you were
generating a random number from 0-100,
if the number was 0-24 the answer would be 1.
if the number was 25-41(25+16) the answer would be 6
if the number was 42-52(42+10) the answer would be 8
if the number was 53-100 the answer would be 4

So you can see the smaller the Error the greater chance the new
population will include that number

New Repopulation = 4, 4, 4, 1
So if you kept on repeating step 2 eventually you would have a
population of all 4's, but 4 is not the answer. So how do we get the
answer in our population if we don't have 3 in the initial
population?

The answer is step #4.

Step #4 mutation / crossover. In this example we'll just do mutation.
Just generate a random number and replace it in the population.

New population after mutation 4, 4, 4, 9

Step #5 repeat steps 2 - 4 until total Error is acceptable. In this
case until you get an Error of 0.


Kind of make sense???


Eric

Reply With Quote
  #10 (permalink)  
Old 08-06-2005, 06:01 AM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Genetic Algorithm pseudo code:

Problem: Solve 2x+1 = 7 (we know the answer is 3, but work with me)

Step #1 Generate a Random population of numbers:

Population = 1, 6, 8, 4

Step #2 Chose a fitness function. Ours will be Error = ABS(1-(2x +
1)/7)

Error(1) = ABS(1-(2x1+1/7)) = 0.57
Error(6) = ABS(1-(2x6+1/7)) = 0.86
Error(8) = ABS(1-(2x8+1/7)) = 1.43
Error(4) = ABS(1-(2x4+1/7)) = 0.29

The number with the smallest Error is closest to the answer. (Still
with me?)

Step #3 Repopulate your population based on your fitness function
results. This is the tough part to grasp. We need to normalize all of
the errors so we can get a repopulation percentage. This will help us
get the new population of numbers.

Take the total of the error 0.57 + 0.86 + 1.43 + 0.29 = 3.15

3.15/0.57 = 5.53
3.15/0.86 = 3.66
3.15/1.43 = 2.20
3.15/0.29 = 10.86

Take the total of the normalized error = 5.53 + 3.66 + 2.20 + 10.86
=22.25

Repopulation percentage for 1 = 5.53/22.25 = 25%
Repopulation percentage for 6 = 3.66/22.25 = 16%
Repopulation percentage for 8 = 2.20/22.25 = 10%
Repopulation percentage for 4 = 10.86/22.25 = 49 %

So now you repopulation your population, this means if you were
generating a random number from 0-100,
if the number was 0-24 the answer would be 1.
if the number was 25-41(25+16) the answer would be 6
if the number was 42-52(42+10) the answer would be 8
if the number was 53-100 the answer would be 4

So you can see the smaller the Error the greater chance the new
population will include that number

New Repopulation = 4, 4, 4, 1
So if you kept on repeating step 2 eventually you would have a
population of all 4's, but 4 is not the answer. So how do we get the
answer in our population if we don't have 3 in the initial
population?

The answer is step #4.

Step #4 mutation / crossover. In this example we'll just do mutation.
Just generate a random number and replace it in the population.

New population after mutation 4, 4, 4, 9

Step #5 repeat steps 2 - 4 until total Error is acceptable. In this
case until you get an Error of 0.


Kind of make sense???

I can give you sample code but it won't make sense unless you
understand the concept of evolutionary codes.

Eric

Reply With Quote
  #11 (permalink)  
Old 08-08-2005, 08:55 AM
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Hello Eric
Thanks for the psuedo code.It does help to understand the concept of
evolutionary algorithms.Now can you also give the code.I am very eager
to implement it.
Thanks again
Ankit

Reply With Quote
  #12 (permalink)  
Old 08-08-2005, 02:58 PM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

//-------Creates Initial Population
-------------------------------------------------
for (int k=0; k < Popsize; k++)
{
for(int h=0; h < max; h++)
{
Population[k].SingleVector[h]=rand() % 2;
}
StoreCover[k]=evaluate(Faults, Population[k].SingleVector);

}
//--- Genetic Algorithm Iterations
-------------------------------------------------------
for (int y=0; y < 10; y++) //---- 10 itertions
{
total=0;
//------Repopulation Based on Coverage Criterian
-------------------------------------
posistion=1;
value1=0;
value2=0;
value3=0;
for (k=0; k < max; k++)
Population[0].repopulation[k]=Population[0].SingleVector[k];
// ---- Makes sure non of the values repeat in repopulation
for (k=1; k < Popsize; k++)
{
for (int h=0; h<k ;h++)
{
value1=0; value2=0;
for (int L=0; L < max; L++) if (Population[h].repopulation[L]==1)
value1=value1+ pow(2,L);
for (L=0; L < max; L++) if (Population[k].SingleVector[L]==1)
value2=value2+ pow(2,L);
if (value1 != value2)
{
value3=0;
}else{ value3=1; h=k;}
}
if (value3==0)
{
for (int j=0; j < max; j++)
Population[posistion].repopulation[j]=Population[k].SingleVector[j];
posistion++;
}
}
// cout << "Fixed population \n";
for (k=0; k < posistion; k++)
{
// for (int n=0; n< max; n++)
// {
// cout <<Population[k].repopulation[n];
// }
StoreCover[k]=evaluate(Faults, Population[k].repopulation);
// cout << " " << StoreCover[k] << "\n";
}
// cout << "\n\n\n";
for (k=0; k < posistion; k++)
{
total=total+ StoreCover[k];
}
// cout << "\n\n total=" <<total;

for (int p=0; p<Popsize; p++)
{

random=rand() % 101; //Generates random populations
// cout << "\n";

int start=0, end=0;
for (k=0; k < Popsize; k++)
{
start=end;
end=end+(StoreCover[k]*100/total);
if ((random>=start) && (random<end))
{
for (int n=0; n< max; n++)
{
Population[p].NewVector[n]=Population[k].repopulation[n];
// cout <<Population[k].SingleVector[n];
}
}
}
}
// cout <<"\n";
for (k=0; k < Popsize; k++) //--Swaps NewVector with SingleVector
{
for (int n=0; n< max; n++)
{
Population[k].SingleVector[n]=Population[k].NewVector[n];

// cout <<Population[k].SingleVector[n];
}
StoreCover[k]=evaluate(Faults, Population[k].SingleVector);
// cout << " " << StoreCover[k] << "\n";
}
//------------------------------------------------------------------------------------
// ------ Cross Overs
----------------------------------------------------------------
int random1=rand() % Popsize; //Find 1st vector to swap
int random2=rand() % Popsize; //Find second Vector to swap
int random3=rand() % max; //Finds place to cut
int temp=0;
// cout << "Cross Over " << random1 << " " << random2 << " " <<
random3 <<"\n";
for (int n=0; n< random3; n++)
{
temp=Population[random1].SingleVector[n];
Population[random1].SingleVector[n]=Population[random2].SingleVector[n];
Population[random2].SingleVector[n]=temp;

}
for (k=0; k < Popsize; k++)
{
// for (n=0; n< max; n++)
// {
// cout <<Population[k].SingleVector[n];
// }
StoreCover[k]=evaluate(Faults, Population[k].SingleVector);
// cout << " " << StoreCover[k] << "\n";
}
//------------------------------------------------------------------------------------
// ------ Mutation
----------------------------------------------------------------
random1=rand() % Popsize; //Find 1st vector to swap
random3=rand() % max; //Finds place to swap
// cout << "Mutation " << random1 << " " << random3 <<"\n";

if (Population[random1].SingleVector[random3]==0)
Population[random1].SingleVector[random3]=1;
else Population[random1].SingleVector[random3]=0;

for (k=0; k < Popsize; k++)
{
// for (n=0; n< max; n++)
// {
// cout <<Population[k].SingleVector[n];
// }
StoreCover[k]=evaluate(Faults, Population[k].SingleVector);
// cout << " " << StoreCover[k] << "\n";
}
//------------------------------------------------------------------------------------
}
//-------------Displays final population
---------------------------------------------------
// cout << "Final Set of Vectors\n";
for (k=0; k < posistion; k++) //posistion = number of elements
{
for (int n=0; n< max; n++)
{
// cout <<Population[k].repopulation[n]; //final nonrepeating
elements
}
StoreCover[k]=evaluate(Faults, Population[k].SingleVector);
// cout << " " << StoreCover[k] << "\n";
}
}

Reply With Quote
  #13 (permalink)  
Old 08-08-2005, 11:03 PM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

I found this Masters Thesis on how one person use Genetic Algorithms to
create a FPGA netlist.

http://www.ce.chalmers.se/~mekman/MasterThesis.pdf

Pretty Good Masters project.

Reply With Quote
  #14 (permalink)  
Old 08-10-2005, 06:46 AM
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Hi Eric
Thanks for the code. It is quite complicated as compared to the psuedo
code. I tried making my own application in C#.It works sometimes but
sometimes it just enters an idefinite loop.This is when my population
values go beyond the right hand side constant value(ax + b = c
'value of constant c').I have a few questions for you:
1. What if you get the answer in the first population, the
corresponding normalised value would be infinite?
2.Are there any special conditions you need to check before populating
the list?

Here is my code which is based on your psuedo code.see if it makes
sense to you.
I really appreciate your help.
private void ImplementGA()
{
Random rnd = new Random();
int popsize=6;
int[] population = new int[popsize];
int i;
bool Found=false;
DateTime dt= new DateTime();
double a,b,c;
a=double.Parse(CoefficientTextBox.Text);
b=double.Parse(Constant1TextBox.Text);
c=double.Parse(Constant2TextBox.Text);



//Step 1
//Generate a random population
listBox1.Items.Add("Initial Population");
for(i=0;i<popsize;i++)
{
population.SetValue((int)(rnd.NextDouble()*10),i);
listBox1.Items.Add(population[i]);
}
listBox1.Items.Add("");
listBox1.Items.Add("");





//Step 2
//Fitness Function
listBox1.Items.Add("Corresponding Fitness Values");
double[] fitness = new double[popsize];
//(ax + b = c)
int x;
for(i=0;i<popsize;i++)
{
//fitness = ABS(1 - ((ax + b)/c))
x=population[i];
fitness[i] = Math.Abs(1 - ((a*x + b)/c));
listBox1.Items.Add(fitness[i]);
}
listBox1.Items.Add("");
listBox1.Items.Add("");





//My idea to check before repopulating
//Check for the end condition
for(i=0;i<popsize;i++)
{
if(fitness[i] == 0)
{
Result=population[i];
Found=true;
}
//else
//Found=false;
}




while(Found == false)
{
//Step 3
//Repopulate the population based on the fitness function
double ErrorTotal=0, NormalisedError=0;
double[] normalised = new double[popsize];
int[] RepopulationPercentage = new int[popsize];
for(i=0;i<popsize;i++)
{
ErrorTotal = ErrorTotal + fitness[i];

}
listBox1.Items.Add("Total Error = "+ErrorTotal);
//normlization
listBox1.Items.Add("");
listBox1.Items.Add("");
listBox1.Items.Add("");

listBox1.Items.Add("Normalisation values");
for(i=0;i<popsize;i++)
{
normalised[i] = ErrorTotal / fitness[i];
listBox1.Items.Add(normalised[i]);
}
//total of normalised error
for(i=0;i<popsize;i++)
{
NormalisedError = NormalisedError + normalised[i];
}
if(NormalisedError > 99999999)
Flag = true;
listBox1.Items.Add("");
listBox1.Items.Add("");
listBox1.Items.Add("Normalised Error = "+NormalisedError);
//Repopulation percentage
listBox1.Items.Add("");
listBox1.Items.Add("");
listBox1.Items.Add("Repopulation percentage");
for(i=0;i<popsize;i++)
{
RepopulationPercentage[i] = (int)((normalised[i] /
NormalisedError) * 100);
listBox1.Items.Add(RepopulationPercentage[i]);
}


//Elitism - copy the best solution to the next generation
int Best=100;
for(i=0;i<popsize;i++)
{
if(Flag==false)
{
if(Best>=RepopulationPercentage[i])
{
Best=population[i];
}
}
else if(fitness[i] == 0)
{
Best=population[i];
}

}
listBox1.Items.Add("Best = "+Best);



//Step 4
//Repopulate - Only mutation is being used
population[0]=Best;

//Crossover
listBox1.Items.Add("After Crossover");
listBox1.Items.Add(population[0]);
for(i=1;i<popsize-1;i++) //elements
{
population.SetValue((int)((population[i]+population[i+1])/2),i);
listBox1.Items.Add(population[i]);
}
population[popsize-1]=Best + 1;
listBox1.Items.Add(population[popsize-1]);




//Mutation
listBox1.Items.Add("After Mutation");
listBox1.Items.Add(population[0]);
for(i=1;i<popsize;i=i+2) //elements
{
if(dt.Second%2 == 0)
population.SetValue((int)(population[i]+1),i);
else
population.SetValue((int)(population[i]-1),i);

listBox1.Items.Add(population[i]);
}

listBox1.Items.Add("Above list is the final population");




//Calculate the fitness of the new population
listBox1.Items.Add("New population fitness");
for(i=0;i<popsize;i++)
{
//fitness = ABS(1 - ((ax + b)/c))
x=population[i];
fitness[i] = Math.Abs(1 - ((a*x + b)/c));
listBox1.Items.Add(fitness[i]);
}




//Check for the end condition
for(i=0;i<popsize;i++)
{
if(fitness[i] == 0)
{
Result=population[i];
Found=true;
}
//else
// Found=false;
}
}

//Display the answer
AnswerTextBox.Text = Result.ToString();
}

Reply With Quote
  #15 (permalink)  
Old 08-10-2005, 03:05 PM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Your code looks pretty good.

To answer your first question: If your answer is found in the first
population you just got lucky and you're done! Your correct in the
way you check for if the Error == 0 you stop, or the normalized value
would be infinite.

I have had similar issues with the answer diverging on some iterations.
What you need to do is have a fixed number of iterations like 100, That
way it won't ever be in an infinite loop. Another thing to try would be
use a larger population 6 is pretty small.

Another thing to do is keep track of you populations total error, if it
is not going down, maybe introduce more mutations. There are a bunch of
ways to try and get your population to evolve into the answer faster.

Since your know in this particular problem ax + b can not be greater
than c, you can use this to evaluate each random number in your
population. If you number violates this property, then just throw out
that number and get a new random number. This is kind of cheating,
since the repopulating should naturally weed out these answers. One
other option would be to give numbers that violate the ax+b = c a very
large Error, that way they just won't get repopulated.

One other thing to check is make sure you repopulation function is
running correctly. It is very easy to make a mistake in that function.

Good Luck

Eric

Reply With Quote
  #16 (permalink)  
Old 08-10-2005, 03:16 PM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Another thing to try is make your fitness function non-linear.

Error = (1-(ax+b)/c)^4

This will make the Error huge on values that are far away from the
answer.

Eric

Reply With Quote
  #17 (permalink)  
Old 08-12-2005, 08:43 AM
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Hi Eric
You can download the .exe file fom the following link:
http://rapidshare.de/files/3899362/E...Solve.exe.html
I have limited the iterations to 1000 , so that it can solve equations
like 13x + 4 = 615.
It does it successfully.
Once agains thanks
Ankit

Reply With Quote
  #18 (permalink)  
Old 08-12-2005, 02:50 PM
Eric
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Very cool program.

Evolutionary codes are pretty cool.... Just think you solved a problem
by using random numbers.

Congrats!

Reply With Quote
  #19 (permalink)  
Old 08-14-2005, 06:33 AM
Rob Ryland
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

"Eric" <[email protected]> wrote in
news:[email protected] oups.com:

> Genetic Algorithm pseudo code:
>
> Problem: Solve 2x+1 = 7 (we know the answer is 3, but work with me)
>
> Step #1 Generate a Random population of numbers:
>
> Population = 1, 6, 8, 4
>
> Step #2 Chose a fitness function. Ours will be Error = ABS(1-(2x +
> 1)/7)
>
> Error(1) = ABS(1-(2x1+1/7)) = 0.57
> Error(6) = ABS(1-(2x6+1/7)) = 0.86
> Error(8) = ABS(1-(2x8+1/7)) = 1.43
> Error(4) = ABS(1-(2x4+1/7)) = 0.29
>
> The number with the smallest Error is closest to the answer.
> (Still
> with me?)
>
> Step #3 Repopulate your population based on your fitness function
> results. This is the tough part to grasp. We need to normalize all of
> the errors so we can get a repopulation percentage. This will help us
> get the new population of numbers.
>
> Take the total of the error 0.57 + 0.86 + 1.43 + 0.29 = 3.15
>
> 3.15/0.57 = 5.53
> 3.15/0.86 = 3.66
> 3.15/1.43 = 2.20
> 3.15/0.29 = 10.86

************** Bunch of quoted text trimmed *********************
>
>
> Kind of make sense???
>
>
> Eric
>


Good lord, that will just confuse them!...
Of course you realize that your example algorithm converges a
little slower than just guessing until you've guessed the right
answer. I say a little slower because what you've described
essentially IS just guessing until you happen upon the right answer,
with a few extra operations to slow everything down! The magic in a
genetic algorithm comes from the ***, which happens in the crossover
that you omitted in step 4 above. You HAVE to come up with a way to
combine two 'pretty good' solutions to get another 'pretty good,
maybe a bit better' solution. Without that combination step
(analogous to *** in the world of biology), you don't have a genetic
algorithm at all! Now finding a way to combine two 'pretty good'
solutions to come up with a new 'pretty good' solution is sometimes
difficult. In your example it would be easy; simply average (or
perhaps a randomly weighted mean) the parents to get the offspring.
Now that would actually converge to a solution in your example.
The mutation part is less important than the *** part, but still
needed. But i don't think i've EVER seen mutation implemented as
simply making up a wholy new, randomly generated member of the
population. That would be no better than (and roughly equivilent to)
having a larger initial population. The mutation must be a
relatively small change to an existing member of the population. The
idea is that your population will, after a few generations, be much
better adapted than a randomly generated individual and a small
change will have a decent chance of being 'pretty good' too.

I don't mean to be insulting or belittle the contribution to the
newsgroup, but genetic algorithms are important and your example
could easily confuse people.

-Rob Ryland
Reply With Quote
  #20 (permalink)  
Old 08-15-2005, 01:42 AM
Guest
 
Posts: n/a
Default Re: Where can i find GeneticFPGA toolkit

Hi Rob
I undertsand why you are making a point about crossover.I have done
exactly the same thing. I use a special class to compare and sort the
population based on their fitness. Keeping in mind 'elitism',I also
copy the best solution to the new population. Then from a population of
six, I select 4 best values and average out consequent numbers.
Mutation- to randomise mutation process ,I select 4 members after
crossover and either add 1 0r subtract 1 depending on computer clock
ticks.This process is completely random.
Here's a piece of code for the above:

//Elitism - copy the best solution to the next generation
Array.Sort(RepopulationPercentage);
Best = RepopulationPercentage[popsize-1].accessElement;
listBox1.Items.Add("Best = "+Best);

//Crossover
int m=popsize-1;
listBox1.Items.Add("After Crossover");
listBox1.Items.Add(population[0]);
for(i=1;i<popsize-1;i++) //elements
{
population.SetValue((int)((RepopulationPercentage[m].accessElement+RepopulationPercentage[m-1].accessElement)/2),i);
listBox1.Items.Add(population[i]);
m--;
}
if(dt.Ticks%2 == 0)
population[popsize-1]=Best - 1;
else
population[popsize-1]=Best + 1;

//Mutation
listBox1.Items.Add("After Mutation");
listBox1.Items.Add(population[0]);
for(i=1;i<popsize;i=i+2) //elements
{
if(dt.Ticks%2 == 0)
population.SetValue((int)(population[i]+1),i);
else
population.SetValue((int)(population[i]-1),i);
listBox1.Items.Add(population[i]);
}

Eric's psuedo code and a genetic algorithm template from a website
helped me write the code.
Ankit

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
where to find the bfm files? bjzhangwn Verilog 0 01-20-2006 11:15 AM
Cannot find net in ucf, but it's there.... [email protected] FPGA 5 07-01-2005 07:19 AM
Can't find folder AL FPGA 0 04-18-2005 10:56 PM
How do I find where P&R has placed my BRAM? Symon FPGA 2 05-12-2004 09:10 PM


All times are GMT +1. The time now is 03:16 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved