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 a evaluate function that returns logprior and loglikelihood #247

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Dec 5, 2024

_tempered_evaluate!! returns updated evaluation_env and a NamedTuple of logprior, loglikelihood and tempered_logjoint (tempered_logjoint = logprior + temperature * loglikelihood(x)).

@coveralls
Copy link

coveralls commented Dec 5, 2024

Pull Request Test Coverage Report for Build 12184482120

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 31 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.1%) to 70.755%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/model.jl 0 31 0.0%
Totals Coverage Status
Change from base Build 12106477189: -1.1%
Covered Lines: 1396
Relevant Lines: 1973

💛 - Coveralls

@sunxd3 sunxd3 changed the title Add a test evaluate function that returns logprior and loglikelihood Add a evaluate function that returns logprior and loglikelihood Dec 5, 2024
@sunxd3 sunxd3 merged commit bac2171 into master Dec 5, 2024
13 checks passed
@sunxd3 sunxd3 deleted the sunxd/add_tempered_evaluate_function branch December 5, 2024 17:01
Copy link
Contributor

github-actions bot commented Dec 5, 2024

Benchmark results on macOS (aarch64)

BridgeStan not found at location specified by $BRIDGESTAN environment variable, downloading version 2.5.0 to /Users/runner/.bridgestan/bridgestan-2.5.0
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.1582 7.54167 51.375 251.75
pumps 12 10 0.940839 1.42915 8.889 19.792
dogs 2 720 NA NA 130.875 264.667
seeds 26 21 2.119 2.8375 21.209 52.5
surgical_realistic 14 12 1.18832 1.67888 11.3125 25.0
magnesium 108 96 10.8335 12.104 98.291 184.083
salm 22 18 3.79171 4.4445 16.209 40.291
equiv 15 20 3.45312 4.34033 14.375 53.125
dyes 9 30 1.55921 2.0625 9.04167 41.209
stacks 6 21 1.25365 1.93607 17.25 43.75
epil 303 236 39.542 43.875 196.833 585.416
blockers 47 44 2.53409 3.11567 42.292 81.875
oxford 244 240 11.0415 13.375 255.75 495.292
lsat 1006 5000 98.917 135.125 1334.88 3032.54
bones 33 422 74.375 85.125 307.084 402.125
mice 20 65 6.75 8.5 32.5 91.208
kidney 64 58 8.639 11.875 66.416 182.625
leuk 18 714 16.417 21.625 259.042 448.5
leukfr 40 714 22.75 29.209 280.166 554.771

Benchmark results on Ubuntu (x64)

BridgeStan not found at location specified by $BRIDGESTAN environment variable, downloading version 2.5.0 to /home/runner/.bridgestan/bridgestan-2.5.0
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.6968 8.34533 67.877 83.917
pumps 12 10 0.9805 1.36164 11.747 6.37925
dogs 2 720 NA NA 179.115 149.339
seeds 26 21 2.422 3.18933 26.55 19.696
surgical_realistic 14 12 1.24665 1.68428 15.7795 8.43567
magnesium 108 96 10.4645 12.123 122.805 75.111
salm 22 18 2.7301 3.23611 20.799 12.4785
equiv 15 20 2.41367 3.439 18.816 17.553
dyes 9 30 1.00638 1.33659 12.0575 13.1045
stacks 6 21 1.15215 1.72671 17.743 15.039
epil 303 236 33.963 39.234 280.284 242.127
blockers 47 44 3.304 3.73325 56.876 28.353
oxford 244 240 16.32 19.015 322.603 169.627
lsat 1006 5000 183.523 225.381 1980.33 1155.71
bones 33 422 73.607 91.23 430.931 212.788
mice 20 65 7.33375 9.46767 30.1665 38.021
kidney 64 58 10.77 16.38 65.823 70.842
leuk 18 714 20.528 26.71 220.973 216.319
leukfr 40 714 23.854 32.2 234.253 287.914

sunxd3 added a commit that referenced this pull request Dec 9, 2024
use `_tempered_evalaute!!` function introduced in
#247 to reduce duplicated
code
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