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 WithinGibbs sampler implementations #131

Merged
merged 33 commits into from
Dec 6, 2023
Merged

Add WithinGibbs sampler implementations #131

merged 33 commits into from
Dec 6, 2023

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Nov 10, 2023

This PR:

src/gibbs.jl Outdated Show resolved Hide resolved
src/gibbs.jl Outdated Show resolved Hide resolved
src/gibbs.jl Outdated Show resolved Hide resolved
src/gibbs.jl Outdated Show resolved Hide resolved
src/gibbs.jl Outdated Show resolved Hide resolved
src/markov_blanket_model.jl Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Nov 10, 2023

Pull Request Test Coverage Report for Build 6841824404

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 70 of 114 (61.4%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-1.2%) to 74.53%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/graphs.jl 12 13 92.31%
src/markov_blanket_model.jl 50 59 84.75%
src/gibbs.jl 0 34 0.0%
Files with Coverage Reduction New Missed Lines %
src/model.jl 1 83.06%
Totals Coverage Status
Change from base Build 6737589416: -1.2%
Covered Lines: 1349
Relevant Lines: 1810

💛 - Coveralls

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (49d38d4) 75.75% compared to head (120d014) 77.21%.

Files Patch % Lines
src/model.jl 82.41% 16 Missing ⚠️
ext/JuliaBUGSAdvancedMHExt.jl 0.00% 3 Missing ⚠️
src/graphs.jl 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   75.75%   77.21%   +1.46%     
==========================================
  Files          20       21       +1     
  Lines        1757     1826      +69     
==========================================
+ Hits         1331     1410      +79     
+ Misses        426      416      -10     

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

ext/JuliaBUGSMCMCChainsExt.jl Outdated Show resolved Hide resolved
ext/JuliaBUGSMCMCChainsExt.jl Outdated Show resolved Hide resolved
test/gibbs.jl Outdated Show resolved Hide resolved
MarkovBlanketBUGSModel constructor
ext/JuliaBUGSAdvancedHMCExt.jl Outdated Show resolved Hide resolved
ext/JuliaBUGSAdvancedHMCExt.jl Outdated Show resolved Hide resolved
ext/JuliaBUGSAdvancedMHExt.jl Outdated Show resolved Hide resolved
ext/JuliaBUGSAdvancedMHExt.jl Outdated Show resolved Hide resolved
test/graphs.jl Outdated Show resolved Hide resolved
test/graphs.jl Outdated Show resolved Hide resolved
@sunxd3 sunxd3 marked this pull request as ready for review November 24, 2023 15:44
@sunxd3
Copy link
Member Author

sunxd3 commented Nov 24, 2023

@yebai I think this is finally ready. Some tests may fail, but they should be okay, just artifacts from MHFromPrior.

The condition and decondition are added and used.

I removed MarkovBlanketModel, now we only have one kind of model BUGSModel. For models produced by conditioning, their sorted_nodes will only contain the unobserved random variables and corresponding markov blanket instead of all the variables in the model.

src/model.jl Show resolved Hide resolved
src/gibbs.jl Outdated Show resolved Hide resolved
test/gibbs.jl Outdated Show resolved Hide resolved
@yebai
Copy link
Member

yebai commented Nov 28, 2023

The numbers here seem quite off from the ground truth -- maybe double-check the implementation?

@sunxd3
Copy link
Member Author

sunxd3 commented Nov 29, 2023

@yebai I have never seen this happens before, and it's produced by running HMC in a Gibbs fashion. Is it possible that this is just one bad chain?

@sunxd3
Copy link
Member Author

sunxd3 commented Dec 3, 2023

@yebai some tests are passing so I think the implementation is correct. For that I think this PR can be merged.

The issue is that Gibbs runs slowly for many reasons include type unsuitability and unnecessary deepcopies, so I can't make it work and test on slightly larger models. I'll do a refactor and an efficiency update to make it runs better, but that belongs to another PR.

@sunxd3 sunxd3 merged commit 443f83c into master Dec 6, 2023
10 of 13 checks passed
@sunxd3 sunxd3 deleted the sunxd/simple_gibbs branch December 6, 2023 10:10
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