Skip to content
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

Add getparams and get_params_varinfo functions #113

Merged
merged 10 commits into from
Oct 12, 2023
Merged

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Oct 5, 2023

In light of TuringLang/Turing.jl#2097, we know sometimes computation with ReverseDiff compiled can be wrong because LogDensityProblemsAD uses zeros array for the compilation process.

This PR added a function getparams similar to DynamicPPL.jl's.

The PR also update the function get_params_varinfo so that we can return a DPPL compatible SimpleVarInfo with values in unconstrained space.

@sunxd3 sunxd3 changed the title Add getparams and get_params_varinfo function Add getparams and get_params_varinfo functions Oct 5, 2023
src/model.jl Outdated Show resolved Hide resolved
@yebai yebai requested a review from torfjelde October 5, 2023 16:22
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (e3f5487) 71.42% compared to head (fb699dd) 72.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
+ Coverage   71.42%   72.16%   +0.73%     
==========================================
  Files          16       16              
  Lines        1673     1692      +19     
==========================================
+ Hits         1195     1221      +26     
+ Misses        478      471       -7     
Files Coverage Δ
src/model.jl 83.71% <100.00%> (+4.99%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sunxd3
Copy link
Member Author

sunxd3 commented Oct 12, 2023

The HMC inference tests take too long now, I will find a way to make them faster and then enable them in CI (right now, I am running them locally before merging).

The issue right now seems to be that I put the tests in separate @testset, so a lot of repeated compilations are happening.

@sunxd3 sunxd3 marked this pull request as ready for review October 12, 2023 08:31
@yebai yebai merged commit 889f0f9 into master Oct 12, 2023
13 checks passed
@yebai yebai deleted the sunxd/add_get_params branch October 12, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants