-
Notifications
You must be signed in to change notification settings - Fork 29
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
Move predict
from Turing
#716
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The reason is some tests implicitly rely on the variance of the posterior samples. Discarding some initial samples fixes this. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Pull Request Test Coverage Report for Build 12007336979Details
💛 - Coveralls |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #716 +/- ##
==========================================
+ Coverage 84.35% 84.55% +0.19%
==========================================
Files 30 30
Lines 4211 4259 +48
==========================================
+ Hits 3552 3601 +49
+ Misses 659 658 -1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
We had a fast discussion on this today at the meeting. Tor raised that we should probably implement Also although we don't use |
Specifically, I was thinking |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
varinfos::AbstractArray{<:AbstractVarInfo}; | ||
include_all=false, | ||
) | ||
predictive_samples = Array{PredictiveSample}(undef, size(varinfos)) |
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.
Do we really need the PredictiveSample
here?
My original suggestion was just to use Vector{<:OrderedDict}
for the return-value (an abstractly typed PredictiveSample
doesn't really offer anything beyond this, does it?)
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.
I haven't think too deep about this. A new type certainly is easier to dispatch on, but may not be necessary. Let me look into it
Otherwise stuff is starting to look nice though:) |
This PR aims to move
predict
function from Turing.jl repo to here (DynamicPPL). This PR won't change the way thatpredict
is fundamentally implemented. (Later in #651, we will transition to usingfix
to implementpredict
.)The challenge of this PR is that:
predict
returns aMCMCChains.Chain
Chain
generation pipeline in Turing.jl (same pipeline called at the end ofsample
)Chain
-related util functions into DynamicPPLWhat I have done as of now:
predict
function and recovered a subset of the util functions needed to make it functionalsample
in tests now usesLgoDensityFunction
interfaceModifications made to the moved util functions are:
AbstractMCMC.bundle_samples
are renamed to_bundle_samples
; unused keywords arguments are removedTransition
type is copied from Turing.jl repo, but thestat
field is removed as it is never used inpredict
But most of the functions in the PR right now should be the same or straightforwardly identifiable from Turing.jl code.