开发者

Neural Networks Algorithms or something like that to Find Appropriate Parameters for an Application that Uses Genetic Algorithms to Run It Less Time

I developed an application with Java that uses genetic algorithms. My application needs parameters as like:

 How many genes will be populate at first?
 How many genes will be killed after crossover and mutation?
 What will be the mutation rate?

I can test something as like:

How long(milliseconds) does it take to find a solution.

How can I find the good values as parameters for my application. I mean I will give as an input that results:

Genes to populate |  Genes to kill   |   Mutation rate   |   Result(milliseconds)
---------------------------------------------------------------------------------
50                        5                 16/1000                 146
50                        5                 16/1000                 208
50                        5                 16/1000                 1000
50                        5                 16/1000                 216
100                       5                 16/1000                 178
100                       5                 16/1000                 546
100                       5                 16/1000                 646
100                       5                 16/1000                 46
100                       5                 16/1000                 186
50                        10                16/1000                 346
50                        10                16/1000                 246
50                        10                16/1000                 546
50                        5                 34/1000                 746
50                        5                 34/1000                 186
50                        5                 34/1000                 196
50                        10                34/1000                 496
50                    开发者_C百科    10                34/1000                 23
50                        10                34/1000                 169

That results are random. I didn't test my program.

After I run that algorithm(I think I will give a result time that is good for me for example 78 milliseconds) it will say something like that:

You should use that parameters to get a result that takes 78 milliseconds:
Genes to populate |  Genes to kill   |   Mutation rate   
--------------------------------------------------------
34                        7                  24/1000        

PS1: One more is that, what strategy I should follow to test it. For example just changing one parameters and test them some number of times and changing other parameter etc.etc.(I tried to give my example values as like that) or testing some values and find one parameter and using that parameter always and testing other parameters that changes one by one and finding other parameter and using that two parameters and changing other one by one and going on like that.

PS2 I can use an API or a software program to find it too.

EDIT: These are my variables that I use nowwith their values:

MAX_POPULATION_SIZE = 50;
HARD_WEIGHTS = {1,20,1,1,1,20,1};/* It means that I have 7 variables for this */
NUMBER_OF_GENES_TO_KILL = 5;
MUTATION_RATE = 100;
MAX_MUTATION_NUMBER = 1000;
/* Mutation rate is MUTATION_RATE/MAX_MUTATION_NUMBER */


I'd get some statistics for parameter combinations first
(actually it seems possible to try all combinations - or do you have more parameters?)
Then the direct way would be to build some kind of mapping from these statistics, like
{a,b,c} -> {min,max,avg,dev}
(parameters to metric value stats)
and then find the parameter sets corresponding to desired metric value.

It would be more complicated if parameter space is too large so that full enumeration is impossible. Then you'd have to build a smaller approximation of parameter space first, after gathering enough samples at random points.

Update:
Its may be possible to make use of some existing tools. Basically, its the same task as what statistical data compressors have to do. So its possible to prepare a (binary) table with N {metric;params} rows to build the model, and then {metric;...} partial row. Then, after processing the desired metric value, we'd have to feed random data to the decoder (instead of valid arithmetic code), and it would decode the "most probable" parameter combination based on accumulated statistics.
The best tool for that would be probably paq8 - http://www.mattmahoney.net/dc/#paq
A simple demonstration of suggested idea would be to compress a text with paq8, then modify the archive near the end (introduce an error). The (broken) file unpacked from the archive would usually contain a generated sentence after the error.
Paq8 usually can detect the row size in a table, but its prediction may be improved in such case by adding a .bmp header to the table, with specific table dimensions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜