Turing.jl: Passing RNG

Created on 27 Jul 2019  路  7Comments  路  Source: TuringLang/Turing.jl

Turing.jl now support passing RNG to sample as a keyword argument. Although, all the randome process in AdvancedHMC.jl are correctly controlled by the passed RNG, the initialization, from Turing.jl, is not: https://github.com/TuringLang/Turing.jl/blob/master/src/inference/hmc.jl#L267. What's the best way to pass RNG to this?

Most helpful comment

Yeah, I think that's wise.

All 7 comments

In the future, which I know is not super helpful right now, the sample interface will handle the rng argument in a first-class way. The file I linked below basically forces all samplers to accept rng as the first argument, though as far as I am aware only the HMC samplers use it. The particle samplers, IS, and MH all only use the argument for dispatch and discard the actual value.

https://github.com/TuringLang/Turing.jl/blob/cb811e9b5a151185874f48ef3d8768bebf74f2fa/src/interface/Interface.jl#L216

This should be easy to fix once your PR is ready.

@trappmartin do you mean it's better for me to leave this issue aside in the current PR and resolve it later?

Yeah, I think that's wise.

871 is merged.

Can we close this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hessammehr picture hessammehr  路  4Comments

mateuszbaran picture mateuszbaran  路  5Comments

scheidan picture scheidan  路  5Comments

Vaibhavdixit02 picture Vaibhavdixit02  路  4Comments

trappmartin picture trappmartin  路  3Comments