Accessing the random seed in the MultiTrace object

If I fit a model using the pymc3.sample() method, without manually setting a random seed (i.e. the random_seed = None argument is left equal to its default value), then is it possible to access the random seeds that were generated by pymc3?

That is, are the random seeds that are generated automatically by pymc3 stored somewhere in the MultiTrace object or similar (so that I can reproduce the fitted model exactly even when I didn’t specify the seed manually)?

Thanks in advance for any response!

Hi Sam,
I can’t answer your exact question, but I’m wondering abou the use case: if you’re concerned about knowing the exact seed, why won’t the random_seed argument fulfill your needs?
PyMCheers and a happy new year :tada:

Yeah I guess I could manually generate random seeds, but I would probably just be replicating what pymc3 is doing internally anyway. So I think it would make more sense for me to let pymc3 do the work and just access that information I guess.

But also, in the hierarchy of functions I have, the user may or may not have explicitly specified the number of chains at the time that I would want to generate and save the random seeds. If the user hasn’t specified the number of chains, then I don’t know the number of seeds to generate. I can create my own default number of chains for example, but then everything in my use case starts to get a bit hacky.

It would be cleaner if I just extract from the fitted model/trace object.

If I get time I could write up a reprex to demonstrate my use case, but not sure it is a wise use of time…!