Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing RNG #870

Closed
xukai92 opened this issue Jul 27, 2019 · 7 comments
Closed

Passing RNG #870

xukai92 opened this issue Jul 27, 2019 · 7 comments

Comments

@xukai92
Copy link
Member

xukai92 commented Jul 27, 2019

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?

@cpfiffer
Copy link
Member

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.

function step!(

@trappmartin
Copy link
Member

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

@xukai92
Copy link
Member Author

xukai92 commented Jul 31, 2019

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

@cpfiffer
Copy link
Member

cpfiffer commented Aug 1, 2019

Yeah, I think that's wise.

@xukai92
Copy link
Member Author

xukai92 commented Aug 1, 2019

#871 is merged.

@trappmartin
Copy link
Member

Can we close this?

@xukai92
Copy link
Member Author

xukai92 commented Sep 12, 2019

Closed by #793.

@xukai92 xukai92 closed this as completed Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants