-
Notifications
You must be signed in to change notification settings - Fork 32
Fix condition
and fix
in submodels
#892
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #892 +/- ##
============================================
+ Coverage 84.76% 85.04% +0.28%
============================================
Files 35 35
Lines 3879 3919 +40
============================================
+ Hits 3288 3333 +45
+ Misses 591 586 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm silly, I deleted the test suite, of course it passed |
Benchmark Report for Commit fcb44e5Computer Information
Benchmark Results
|
Submodels now actually run faster. I was prepared to take a slight hit on performance, but this has exceeded my expectations. |
44d75fe
to
478c879
Compare
8abd633
to
fd0ee1d
Compare
8421c72
to
565f077
Compare
@yebai Oh, I like the newsletter board idea! |
f67d179
to
8c3bff4
Compare
f7884f1
to
2d13f48
Compare
condition
and fix
in submodelscondition
, fix
, and variable prefixing in submodels
4dd93b5
to
8c3bff4
Compare
condition
, fix
, and variable prefixing in submodelscondition
and fix
in submodels
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.
Looks really good, thanks for doing this. I only had tiny comments and questions.
In Turing.jl, GibbsContext might benefit from a similar treatment. Or replacing it with use of ConditionContext. There was some reason why we didn't do that originally, I forget now what it was.
Co-authored-by: Markus Hauru <[email protected]>
I have never taken a look at GibbsContext, but I reckon I can do so after this DPPL release. |
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!
* Release 0.36 * AbstractPPL 0.11 + change prefixing behaviour (#830) * AbstractPPL 0.11; change prefixing behaviour * Use DynamicPPL.prefix rather than overloading * Remove VarInfo(VarInfo, params) (#870) * Unify `{untyped,typed}_{vector_,}varinfo` constructor functions (#879) * Unify {Untyped,Typed}{Vector,}VarInfo constructors * Update invocations * NTVarInfo * Fix tests * More fixes * Fixes * Fixes * Fixes * Use lowercase functions, don't deprecate VarInfo * Rewrite VarInfo docstring * Fix methods * Fix methods (really) * Link varinfo by default in AD testing utilities; make test suite run on linked varinfos (#890) * Link VarInfo by default * Tweak interface * Fix tests * Fix interface so that callers can inspect results * Document * Fix tests * Fix changelog * Test linked varinfos Closes #891 * Fix docstring + use AbstractFloat * Fix `condition` and `fix` in submodels (#892) * Fix conditioning in submodels * Simplify contextual_isassumption * Add documentation * Fix some tests * Add tests; fix a bunch of nested submodel issues * Fix fix as well * Fix doctests * Add unit tests for new functions * Add changelog entry * Update changelog Co-authored-by: Hong Ge <[email protected]> * Finish docs * Add a test for conditioning submodel via arguments * Clean new tests up a bit * Fix for VarNames with non-identity lenses * Apply suggestions from code review Co-authored-by: Markus Hauru <[email protected]> * Apply suggestions from code review * Make PrefixContext contain a varname rather than symbol (#896) --------- Co-authored-by: Hong Ge <[email protected]> Co-authored-by: Markus Hauru <[email protected]> --------- Co-authored-by: Markus Hauru <[email protected]> Co-authored-by: Hong Ge <[email protected]> Co-authored-by: Markus Hauru <[email protected]>
Summary
This PR closes #857, i.e., gives users sensible ways of conditioning and fixing variables in submodels. To aid in understanding this, it also adds a long piece of documentation (PREVIEW HERE) explaining the design.
Performance
In the table below I compare the time taken for
_evaluate!!(model, ...)
onbreaking
(the base branch) andpy/submodel-cond
(HEAD of this PR). For good measure, the followup PR #896 is also benchmarked.The model tested comprises
m
submodels, all of which containn
assumed variables. All times are in µs.Profiling code (click to expand)
TODO
fix
decondition
andunfix
is still sensible (it should be, but you never know...)inargnames
checks, only thecontextual_isassumption
checks; but probably good to test anyway)