How to get seed used in the optimization problem?
이전 댓글 표시
Hi all,
I am working on an optimization problem in which I want to get the seed used after running it in order to launch another optimization problem with the same seed but different configuration and compared the results. How can I get it? I've seen in the documentation it is possible to get the configuration done by exporting the structure "optimproblem". However, in this structure it is just contained the information needed to resume the previous run but not the initial seed or initial population (just the final population).
I would really appreciate any help from your side.
Thank you. BR
El,
답변 (1개)
Alan Weiss
2017년 12월 4일
0 개 추천
If you are using ga, see Reproduce Results. For simulannealbnd, see Reproduce Your Results. For other solvers, use the same ideas.
Alan Weiss
MATLAB mathematical toolbox documentation
댓글 수: 4
ElSer
2017년 12월 4일
Alan Weiss
2017년 12월 4일
I am not sure that I understand you. If you get the state of the global random number stream before running ga, then you can reset the state of the global random number stream before running ga again, and hence reproduce your results. If you don't know the state of the random number stream before running ga, then I believe that you cannot reproduce your result, because (among other reasons) you have no idea how many random numbers ga sampled during its run.
It is possible that I completely misunderstood you, though. See if the link I provided makes this any clearer.
Alan Weiss
MATLAB mathematical toolbox documentation
Walter Roberson
2017년 12월 4일
편집: Walter Roberson
2017년 12월 4일
ga() does not keep any record of the random number seed that was in effect at the time you started the run. You need to set or record it before you start ga(). You can do that with a specific value, such as
rng(12345)
Note: floating point round-off can be different on systems have have different operating system, different MATLAB version, or different CPUs types (especially Intel vs AMD), so setting the same seed is not necessarily going to get you bit-for-bit identical results.
ElSer
2017년 12월 13일
카테고리
도움말 센터 및 File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!