Demonstration

This demonstration is based on the file calibrate_ga.m in the software bundle on the software page. The function calibrates a generational genetic algorithm (GA) on one of four test functions: sphere (f1), saddle (f2), step (f3), and Schaffer's f6 (f6). The function takes two arguments: a string argument with the name of the function to calibrate the GA on, and an optional struct argument with REVAC parameters.

We use Schaffer's f6 to demonstrate REVAC and type calibrate_ga('f6') at the Matlab prompt. On a 2Ghz machine this will take some 20—30 minutes. During execution you will see data of the form

. evaluation 166 [0h, 0m, 19.000000s]
performance: -9944
. evaluation 167 [0h, 0m, 20.000000s]
performance: -9906
. evaluation 168 [0h, 0m, 20.000000s]
performance: -9945

The dot stands for the directory where intermediate results are saved, in this case the current directory. The number after evaluation tells you how fare the search is advanced. Between brackets you see the ellapsed time in hours, minutes and seconds. The next line prints the last result.

When the calibration is finished the result is saved in a file ga_f6.m in the current directory. 5 plots will show the graphical results. The parameters that are calibrated are mutation (1), crossover (2), and population size (3).

The first two plots visualize how the distributions changed during the search and become more focused on promising regions of the paramter space. The one below shows how selected percentiles of the distributions change. The following percentiles are shown: 2.5, 5, 10, 25, 50, 75, 90, 95, 97.5.

Take the upper right graph: at its left hand side, when the calibration is starting, the distribution is still uniform. Towards the right, during the calibration, the percentiles move towards the top, meaning that values close to 1 are more promising. It is also visible that the first parameter (mutation) has a much higher density around lower values. And interesting case is the third parameter, population size. Initially it gets calibrated on values closer to 1, but as the other 2 paramters get calibrated, this one 'smoothes out' and approaches the uniform distribution again.

The surf below shows the same evolution of the distributions in 3D. Sometimes the percentiles are more informative, sometimes the surf. In this case I think the percentiles are more informative.

The next plot to me is the most important. It shows how the Shannon entropy per parameter changes during calibration. The upper left quadrant shows the entropy for each parameter, the upper right the sum over all entropies. Compare this to the lower left where the GA performance can be seen. Here individual evaluations are plottet in magenta. There is a lot of noise and I prefer to look at the smoothed curve in red. It is very clear that after about 350 evaluations no further improvement is possible. And behold, the upper right shows that at this moment the decline in entropy slowed down significantly. The upper left quadrant shows that there is still some shuffle between individual parameters, but the overall entropy is stable. The lower right quadrant shows the smoothed performance again, this time from the inner 75, 50, 25, 10, 5 and 2 percent of the distributions. With more than 3 parameters this can give aditional information on the evolution of the performance.

The last to plots show the density per parameter at the end of the calibration, after 1000 evaluations. The one below shows the distributio over the entire range 0-1. All have the same y-axis. It is clearly visible how the first parameter (mutation) is very peaked while the other paramters are not. The last plot shows a zoom of the same distributions around the peak.