-
Notifications
You must be signed in to change notification settings - Fork 227
Update to the [email protected] interface #2506
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: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…nto update_advancedvi
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…nto update_advancedvi
@Red-Portal, can you fix the tests before I take a look? |
@yebai I marked the PR as a draft so that we can first agree on an interface, and then I flesh out the implementation and the tests. Do we wish we proceed in another way? |
Let's address the interface later or in a separate PR since that might require more discussions. For this PR, let's try to keep the VI interface non-breaking where possible. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Red-Portal can you take a look at the following error:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2506 +/- ##
==========================================
- Coverage 84.27% 82.68% -1.59%
==========================================
Files 21 21
Lines 1456 1461 +5
==========================================
- Hits 1227 1208 -19
- Misses 229 253 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 @Red-Portal. I left some comments below.
One high-level comment: I suggest we unify vi_fullrank_gaussian
and vi_meanfield_gaussian
into a single function, q_distribution(...; gaussian=true|false, fullrank=true|false)
, to reduce code redundancy.
Note on CI errors:
- CI compains about missing
ADVI()
andTruncatedADAGrad()
.
# Use linked `varinfo` to determine the correct number of parameters. | ||
# TODO: Replace with `length` once this is implemented for `VarInfo`. | ||
varinfo_linked = DynamicPPL.link(varinfo, model) | ||
num_params = length(varinfo_linked[:]) |
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.
Can we get the dimentionality via num_params = length(varinfo_linked)
instead of length(varinfo_linked[:])
?
cc @mhauru
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.
This currently doesn't work, so I'll leave it as is for now
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.
Once VarInfo will be based on VarNamedVector we will have a function called length_internal
for this purpose. We can swap that in here once the VarInfo makeover is done.
Sorry for the delay! I've been traveling in the past weeks, but will start working on this now |
…nto update_advancedvi
Pull Request Test Coverage Report for Build 15099815167Details
💛 - Coveralls |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Turing.jl documentation for PR #2506 is available at: |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I'm confused at the CI failure of |
This PR aims to update Turing's
Variational
module to match AdvancedVI's new interface starting fromv0.3
. I will try not to change the interface too much, but given the new features inAdvancedVI
, I think breaking changes will be inevitable. Though the focus will be to provide a good default setting rather than to expose all the features.Currently proposed interface:
Closes #2507
Closes #2508
Closes #2430