-
Notifications
You must be signed in to change notification settings - Fork 46
[WIP] add SGHMC, SGLD trajectories #113
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
Conversation
src/trajectory.jl
Outdated
h::Hamiltonian, | ||
z::PhasePoint | ||
) where {T<:Real} | ||
z′ = step(rng, τ.integrator, h, z, τ.n_steps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably only need to change this line to implmenet SGHMC.
src/trajectory.jl
Outdated
h::Hamiltonian, | ||
z::PhasePoint | ||
) where {T<:Real} | ||
z′ = step(rng, τ.integrator, h, z, τ.n_steps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably only need to change this line to implmenet SGLD.
I left some comments on how to proceed. |
The commit history is messed up. Please rebase and force-push. |
50f8a55
to
0b60062
Compare
ToDo: computing stochastic gradients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xukai92 I have added the updates for SGHMC.
I am still stuck about how we compute the stochastic gradients. My main source of confusion is that there are many AD frameworks supported by Turing ( ForwardDiff, ReverseDiff, Zygote, Tracker). I know Zygote is the way forward. But I keep getting lost in how all of them are handled by Turing. Any pointers to AD documentation for Turing would help.
Furthermore, we need to compute gradients on minibatches, so it is still more details of how the interface should be designed.
I think the design here is Turing/AD-agonistic. All we need to assume is that
I guess there are two options:
|
Just placeholders for now, still getting a feeling for how things are organized in AHMC, at the same time wanted to get started.
Goal is to fix Issue #60 .
Comments are welcome.