-
Notifications
You must be signed in to change notification settings - Fork 6
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
Document initializing Turing #17
Conversation
Codecov Report
@@ Coverage Diff @@
## main #17 +/- ##
=======================================
Coverage 98.65% 98.65%
=======================================
Files 8 8
Lines 223 223
=======================================
Hits 220 220
Misses 3 3 Continue to review full report at Codecov.
|
docs/src/turing.md
Outdated
@@ -0,0 +1,100 @@ | |||
# Using Pathfinder to initializing sampling with Turing | |||
|
|||
If you have a _differentiable_ Turing model, then you can use Pathfinder to initialize its parameters. |
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.
Just my two cents. Differentiable Turing model means one that do not have for loops and integers? Like a model which would run in Zygote or ReverseDiff?
Maybe explain with a footnote?
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.
Thanks, yeah I wrote the text hastily. Should say the technical requirements are that all parameters are continuous and the log-density can be differentiated by an AD framework.
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.
Yes, that what I got the intuition. But a footnote would solve this all. Thanks!
With #25, we can run Pathfinder on a Turing prob = optim_problem(model, MAP(); constrained=false)
pathfinder(prob, 1) It's probably worth it to add a conditionally loaded interface for a Turing model that makes it easy to draw samples into a format useful for Turing users, e.g. as an |
This PR introduces a docs page showing how to initialize Turing with Pathfinder. Note that to initialize the metric, we'd need to work with AdvancedHMC directly, but this is really clunky right now due to the complexity of getting the unconstrained log density. Hopefully there's a simpler way than how I'm currently doing it!