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,

Réponses (1)

Alan Weiss
Alan Weiss le 4 Déc 2017

0 votes

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 commentaires

ElSer
ElSer le 4 Déc 2017
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
Walter Roberson
Walter Roberson le 4 Déc 2017
Modifié(e) : Walter Roberson le 4 Déc 2017
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 le 13 Déc 2017
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!

Connectez-vous pour commenter.

Question posée :

le 4 Déc 2017

Commenté :

le 13 Déc 2017

Community Treasure Hunt

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

Start Hunting!

Translated by