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

Evaluation Function #275

Closed
wants to merge 32 commits into from
Closed

Conversation

naseweisssss
Copy link
Collaborator

This PR aim to provide an evaluate function for log_posterior

@coveralls
Copy link

coveralls commented Feb 13, 2025

Pull Request Test Coverage Report for Build 13387858561

Details

  • 78 of 112 (69.64%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 79.669%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/experimental/ProbabilisticGraphicalModels/inference.jl 75 109 68.81%
Totals Coverage Status
Change from base Build 13368193073: -0.6%
Covered Lines: 1685
Relevant Lines: 2115

💛 - Coveralls

Copy link
Contributor

Benchmark results on macOS (aarch64)

BridgeStan not found at location specified by $BRIDGESTAN environment variable, downloading version 2.6.1 to /Users/runner/.bridgestan/bridgestan-2.6.1
Done!
Model dogs produces error: ErrorException("log_density() failed with unknown exception\n")

Model Parameter Count Data Count Stan Density Time (µs) Stan Density Gradient Time (µs) JuliaBUGS Density Time with Graph Walk (µs) JuliaBUGS Density Gradient Time with ReverseDiff.jl(compiled tape) (µs)
rats 65 150 5.3834 7.58333 71.542 275.126
pumps 12 10 0.9375 1.1208 10.021 22.333
dogs 2 720 NA NA 192.791 335.5
seeds 26 21 1.98438 2.2465 23.75 62.458
surgical_realistic 14 12 1.27539 1.42822 13.0 28.292
magnesium 108 96 10.8335 11.3335 127.875 231.417
salm 22 18 3.53244 3.73617 16.583 42.083
equiv 15 20 3.61975 3.99317 16.167 50.5
dyes 9 30 1.50437 1.6722 9.646 41.25
stacks 6 21 1.21354 1.57812 18.958 45.041
epil 303 236 34.542 38.917 200.541 553.855
blockers 47 44 2.572 2.82867 48.75 96.792
oxford 244 240 10.6875 12.9375 292.042 565.167
lsat 1006 5000 103.625 140.375 1665.48 3279.79
bones 33 422 79.708 84.708 361.334 399.458
mice 20 65 6.653 8.04167 23.792 97.792
kidney 64 58 8.63867 11.5625 67.625 186.542
leuk 18 714 16.459 21.458 277.917 505.917
leukfr 40 714 22.75 29.791 291.666 598.875

Benchmark results on Ubuntu (x64)

BridgeStan not found at location specified by $BRIDGESTAN environment variable, downloading version 2.6.1 to /home/runner/.bridgestan/bridgestan-2.6.1
Done!
Model dogs produces error: ErrorException("log_density() failed with exception: Exception: bernoulli_lpmf: Probability parameter is inf, but must be in the interval [0, 1] (in '/home/runner/work/JuliaBUGS.jl/JuliaBUGS.jl/benchmark/stan/bugs_examples/vol1/dogs/dogs.stan', line 37, column 6 to line 38, column 62)\n")

Model Parameter Count Data Count Stan Density Time (µs) Stan Density Gradient Time (µs) JuliaBUGS Density Time with Graph Walk (µs) JuliaBUGS Density Gradient Time with ReverseDiff.jl(compiled tape) (µs)
rats 65 150 5.29 7.56067 71.9395 89.457
pumps 12 10 0.951767 1.14365 11.5115 6.3745
dogs 2 720 NA NA 172.863 149.378
seeds 26 21 2.03807 2.56391 26.5 19.957
surgical_realistic 14 12 1.32655 1.48075 14.612 8.52233
magnesium 108 96 10.3695 11.7065 120.024 78.517
salm 22 18 2.28577 2.7642 21.119 12.7085
equiv 15 20 2.51736 3.28167 18.154 15.519
dyes 9 30 1.01439 1.1782 11.5165 14.407
stacks 6 21 1.07719 1.41457 22.853 14.6375
epil 303 236 27.01 33.483 263.742 236.221
blockers 47 44 3.15367 3.4624 55.233 28.784
oxford 244 240 14.011 16.441 308.696 169.356
lsat 1006 5000 160.35 198.435 1838.27 1422.8
bones 33 422 73.126 90.388 418.085 226.743
mice 20 65 7.33625 9.39067 28.814 38.252
kidney 64 58 11.0405 16.621 62.266 69.259
leuk 18 714 21.99 28.223 209.195 193.511
leukfr 40 714 25.948 33.492 228.957 251.303

println("DEBUG: Adding Z2 => Binomial(10, Z1)")
add_stochastic_vertex!(bn, :Z2, (z1) -> Binomial(10, z1), false, :discrete)
println("DEBUG: Adding edge Z1 => Z2")
add_edge!(bn, :Z1, :Z2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
add_edge!(bn, :Z1, :Z2)
add_edge!(bn, :Z1, :Z2)

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.

3 participants