Restarting Genetic Algorithm after Crash
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm using the GA to update my Finite Element Model. The fitness function I am using is computationally expensive and takes 4sec each time it is called. Given that my population size is 200, each generation takes about 13min of computation time. I've set an upper limit of 260 generations, so this process should take a bit more than two days to compute. Of particular concern to me is that my fitness function calls on my Finite Element software (Strand7) which tends to crash from time to time.
I have used the 'OutputFcns' option in gaoptimset along with a function that saves the 'state' structure. This ensures that I have a backup of the state of the last completed generation, prior to crashing.
My question is, "how can I recommence my GA from the last generation using the 'state' structure?"
댓글 수: 0
채택된 답변
Alan Weiss
2013년 5월 31일
편집: Alan Weiss
2013년 5월 31일
You can at least get the population from the state structure, and use it as an initial population if you have to restart the optimization. I think that this should do for most purposes. Of course, you should also adjust the number of generations left to go.
Specifically, I think the following should work:
thePopulation = state.Population;
options = gaoptimset('InitialPopulation',thePopulation,'Generations',130);
But if you will take my advice, forgo using GA, and try using PATTERNSEARCH. Generally, PATTERNSEARCH is faster, more robust, and easier to tune. You might want to start it from a variety of initial points. You can use any points you want as initial points, but for random initial points when you have finite bounds LB and UB on every component, you can try
x0 = LB + rand(size(LB)).*(UB - LB);
Also, for such a computationally expensive function, be sure to turn on the cache option.
options = psoptimset('Cache','on');
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!