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
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
ElSer 2017년 12월 4일
Yes, I am using ga algorithm however what I want is to recover the seed and the type of generator in order to reproduce the optimization problem in other computer or in another different moment than the moment when the simulation was launched. Do you think the link you provided take this into consideration?
Thank you. Best Regards.
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
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
ElSer 2017년 12월 13일
Thank you Alan and Walter for your help. @Alan, reading carefully the link you provided me it turns to solve my problemm, so thanks a lot!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

질문:

2017년 12월 4일

댓글:

2017년 12월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by