liesel-devs / liesel

A probabilistic programming framework
https://liesel-project.org
MIT License
40 stars 2 forks source link

EngineBuilder: What's the difference between the "seed" init argument and the seed set by "set_engine_seed"? #111

Closed jobrachem closed 11 months ago

jobrachem commented 11 months ago

This is not clear to me from the documentation. @wiep or @GianmarcoCallegher, could you clear this up? Probably what's needed is predominantly a clarification in the docs.

GianmarcoCallegher commented 11 months ago

Looks like there is no difference. Also, set_engine_seed is not even used in the tests. Maybe an old version of the constructor didn't take the seed and that method was used for setting it?

wiep commented 11 months ago

If i recall correctly: the seed in the builder is used for the things that happen in the builder and required prng state. moreover, it is initially split to have a value for the engine seed. However, the user can overwrite the engine seed using set_engine_seed. The engine seed is used for the PRNG in the sampling process.

seed --+--> use in builder
       |--> use in engine / sampling    <-- can be overwritten with set_engine_seed.
jobrachem commented 11 months ago

Thanks for clearing that up! Will be useful for