Thread Subject: Randomizing Genetic Algorithm

Subject: Randomizing Genetic Algorithm

From: Priyanshu Agarwal

Date: 22 Feb, 2011 19:00:27

Message: 1 of 2

Hi,

I'm applying GA for minimizing an objective function evaluated from images. When I run MATLAB for the first time and execute the program GA is able to obtain the global minima. However, when I run the program once again, GA fails to find the minima. The above is true no matter how many times I do the same. It seems that the problem lies in the random number generation required for GA. How can I randomize the random number stream being used internally by GA?

Regards,
Priyanshu

Subject: Randomizing Genetic Algorithm

From: Rakesh Kumar

Date: 23 Feb, 2011 22:20:20

Message: 2 of 2

"Priyanshu Agarwal" wrote in message <ik114a$a4e$1@fred.mathworks.com>...
> Hi,
>
> I'm applying GA for minimizing an objective function evaluated from images. When I run MATLAB for the first time and execute the program GA is able to obtain the global minima. However, when I run the program once again, GA fails to find the minima. The above is true no matter how many times I do the same. It seems that the problem lies in the random number generation required for GA. How can I randomize the random number stream being used internally by GA?
>
> Regards,
> Priyanshu

To reproduce the results, save the random number generator stream to reproduce the results.
stream = RandStream.getDefaultStream;
strmstate = stream.State;
% Run GA
stream.State = strmstate;
% Run GA again to get the same results.

It seems that the GA parameter is too sensitive to the options settings or starting population. I would suggest to let GA run longer (change stopping criteria) and/or increase the population size.

In general at least one of the results from 3-4 runs of GA should get you the minimum, if not then change the parameters again.

Hth,
Rakesh

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
genetic algorithm Priyanshu Agarwal 22 Feb, 2011 14:04:26
optimization Priyanshu Agarwal 22 Feb, 2011 14:04:26
rssFeed for this Thread

Contact us at files@mathworks.com