-
Notifications
You must be signed in to change notification settings - Fork 35
Accumulators stage 2 #925
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
base: breaking
Are you sure you want to change the base?
Accumulators stage 2 #925
Conversation
Benchmark Report for Commit 175b633Computer Information
Benchmark Results
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #925 +/- ##
===========================================
Coverage ? 81.11%
===========================================
Files ? 37
Lines ? 4035
Branches ? 0
===========================================
Hits ? 3273
Misses ? 762
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hmmm, in terms of design, the other potential option I see is to make the new
So it seems the main tradeoff is that having it as a positional argument allows for the most efficient varinfo (one without a likelihood accumulator) to be generated if you do e.g. I think my first instinct is that I prefer the latter, and you could either insert a check in the inner constructor to see if the accumulators are consistent (i.e. warn if you have extra accs, or error if you don't have enough accs), or just straight-up call Do you prefer the former? I'll mull over it a bit more too and see if any ideas come up. |
I wouldn't even bother checking for consistency if the user provides both I would be happy to give up the case of There's also something about type dispatch treating keyword args differently. Sometimes methods are specialised on them and sometimes they are not, and I don't understand the details. |
I'm making various changes to accumulators as I integrate Turing.jl with them. This isn't ready for review yet, but @penelopeysm, can I ask you for your thoughts on the design of the proposed changes to LogDensityFunction? It would now have a new field, given as the second constructor argument, called
getlogdensity
. By default it'sgetlogjoint
, but you can set it togetlogprior
orgetloglikelihood
or any other function that takes anAbstractVarInfo
. Its return value will be the return value oflogdensity_and_gradient
etc. The defaultVarInfo
, if one isn't given by the user, is also now set based ongetlogdensity
, to make sure it has the right accumulators.