gneuralnetwork
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gneuralnetwork] Genetic Algorithm on version 0.6.0


From: Jean Michel Sellier
Subject: Re: [Gneuralnetwork] Genetic Algorithm on version 0.6.0
Date: Sat, 26 Mar 2016 18:21:56 +0100

Hey Nan,

This is GREAT! Many thanks for reviewing your own file and fixing these bugs, this is going to save me some time so I can spend it to implement other features ;)

I will run your new file to do a final double check and then immediately include it in the new release of Gneural Network.

MANY thanks again for your support! I REALLY appreciate that!

JM


2016-03-26 18:01 GMT+01:00 D X <address@hidden>:
Hi JM,

I did a self-review on my code, found couple of issues. one is hard code number issue, and another is wrong size calculation issue.

1. crossover function should based on WMAX and WMIN, not hard-coded 0, 1, or -1;
2. I got wrong calculation of pool size, should be SIZE * SIZE;

please see attached c file with both issues fixed.

I think it good to go!

Thanks, and let me know if it have any issues.


Github: https://github.com/cxxaddict
Nan.



Date: Sat, 26 Mar 2016 15:19:32 +0100

Subject: Re: [Gneuralnetwork] Genetic Algorithm on version 0.6.0
From: address@hidden
To: address@hidden
CC: address@hidden; address@hidden

Hi Nan,

Many thanks for this detailed answer. Now I understand and it makes perfectly sense. At this point, I am 100% sure that GA2 is an improvement over GA1. The fact that GA2 might have some problem in getting the global minimum is nothing surprising after all. There is not such a thing as the "perfect optimizer" unfortunately ;)

Thanks again for your very useful contribution!

JM


2016-03-26 15:12 GMT+01:00 D X <address@hidden>:
Hi JM,

I did more tests this morning, I found the old one (we call it GA1) are very easy to get local minimum, strong related to random sequence. the new one (we call it GA2), when we run GA2, the error is always getting smaller, but it is slower and slower.
followings are more detail:

1. we set eps is 0.0001 and neither of these GA can reach or less then this error.
2. GA1 is highly related to the random sequence, when I changed the random generator, the result of GA1 are variable and unstable. but usually it cannot find less error after 10 generations.
3. GA2 are more stable. it always close to less error even you make 100K generations, and when I change the random generator, result is kind of unchanged. always goes to 0.08454...., but the speed it getting slower, which is what we expected.
4. when I change random generator, GA1 may have chance to get less error (0.05....) and worse error(1.0....), but GA2 always goes to about 0.08454...., which is still better than the result of SIMULATED_ANNEALING

I prefer use GA2, but GA2 needs improvement on crossover. it might have some issues make GA2 can not get global min solution.

please let me know if you have any questions,
Thanks,

Github: https://github.com/cxxaddict
Nan.




Date: Sat, 26 Mar 2016 08:58:52 +0100

Subject: Re: [Gneuralnetwork] Genetic Algorithm on version 0.6.0
From: address@hidden
To: address@hidden
CC: address@hidden; address@hidden

Hi Nan,

Thank you so much for improving this method so quickly! I will review it and put it in the next release (which should be online very soon hopefully).

Could you please elaborate on point 4 though? What do you mean by "the solution found by this GA actually is not as good as the old one, but it is still valuable"? Does your method struggle more than the old one to reach some global/local minimum? Many thanks in advance for this further explanation.

Thanks again for contributing to this project!

JM



2016-03-26 4:20 GMT+01:00 D X <address@hidden>:
Hi JM,

I just finished the new GA search.

1. first hard place is crossover. it is very easy to get an out of ranged value if you use classic bit crossover on double numbers. so I make range [WMIN, WMAX] connected, which means I create a ring which WMIN and WMAX are same point.
this way solve the bit crossover out of range issue.

2. suppose each generation we have population SIZE, and each pair of individual will reproduce two new individuals after crossover and mutation. there are SIZE * (SIZE - 1) pairs and plus original SIZE, so the generation pool size should be 2 * SIZE * (SIZE - 1) + SIZE.

3. this GA prefers more generations and less population. when I set more than 100K generations and only 8 population, it still finds a solution. (solution means the error is less than eps, or it cannot get more accurate weight in 100 generations, but it might not be the best solution).

4. the solution found by this GA actually is not as good as the old one, but it is still valuable, because GA is kind of a random search~

attached file is my c and h file, I just added function definition and declaration to the files. I do not have permission to check in code to repo. please review this code, and let me know if you have further thought.

Thanks, 

Github: https://github.com/cxxaddict
Nan.


From: address@hidden
To: address@hidden
Date: Fri, 25 Mar 2016 16:06:21 -0500
CC: address@hidden

Subject: Re: [Gneuralnetwork] Genetic Algorithm on version 0.6.0

Yes, please let me give it a shot.
actually this is my first time to contribute to GNU. Exciting!
I will let you know when I am done.(hopefully soon)
Thanks,

Github: https://github.com/cxxaddict
Nan,



Date: Fri, 25 Mar 2016 21:34:20 +0100
Subject: Re: [Gneuralnetwork] Genetic Algorithm on version 0.6.0
From: address@hidden
To: address@hidden
CC: address@hidden; address@hidden

Hi Nan,

Thanks for this comment! We actually have plans to fix it but if you have any experience with genetic algorithms then you could help us so we go faster. What do you think? Do you feel like you could make a better version everyone could use? Please let us know.

Thanks again for this interesting email!

JM



2016-03-25 20:49 GMT+01:00 COOL MAN <address@hidden>:
Hi guys,

when I review the code 0.6.0 I found that Genetic Algorithm actually is not a real GA, it does not have crossover and selection always picks up the best one so far, and based on this best one to generate candidate solution for next iteration.

do we have any plan to fix this, if possible I can work on this.

Thanks,

Github: https://github.com/cxxaddict

Nan.



--



--



--



--

reply via email to

[Prev in Thread] Current Thread [Next in Thread]