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

Adding node type, and add back missing function #272

Merged
merged 8 commits into from
Jan 31, 2025

Conversation

naseweisssss
Copy link
Collaborator

@naseweisssss naseweisssss commented Jan 28, 2025

This PR is to add an additional node type and add back missing funcntion from previous PR

@coveralls
Copy link

coveralls commented Jan 28, 2025

Pull Request Test Coverage Report for Build 13057065417

Details

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

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/experimental/ProbabilisticGraphicalModels/bayesian_network.jl 0 26 0.0%
Totals Coverage Status
Change from base Build 13006301293: -1.0%
Covered Lines: 1441
Relevant Lines: 1966

💛 - Coveralls

Copy link
Member

@sunxd3 sunxd3 left a comment

Choose a reason for hiding this comment

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

Looks good, just tiny things to fix

)
end

"""
Copy link
Member

Choose a reason for hiding this comment

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

Function docstrings should be lead by the function and type signature, see https://docs.julialang.org/en/v1/manual/documentation/#Functions-and-Methods.

Suggested change
"""
"""
add_stochastic_vertex!(bn::BayesianNetwork{V,T}, name::V, dist::Any,
is_observed::Bool=false, node_type::Symbol=:continuous)::T where {V,T}

end

"""
Add a deterministic vertex.
Copy link
Member

Choose a reason for hiding this comment

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

this also

end

"""
Add a directed edge from `from` -> `to`.
Copy link
Member

Choose a reason for hiding this comment

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

also this

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.0082 7.31933 59.792 236.833
pumps 12 10 0.843414 1.00286 9.0 17.084
dogs 2 720 NA NA 127.916 343.938
seeds 26 21 1.83594 2.37823 21.459 59.292
surgical_realistic 14 12 1.19664 1.34659 11.229 26.584
magnesium 108 96 9.94467 10.854 98.667 207.125
salm 22 18 3.22689 3.54175 18.666 45.833
equiv 15 20 3.40113 3.92257 14.6045 45.0
dyes 9 30 1.51316 1.69531 9.222 39.292
stacks 6 21 1.16332 1.53279 17.0 42.209
epil 303 236 32.125 35.959 190.542 623.125
blockers 47 44 2.56064 2.7875 44.208 82.8545
oxford 244 240 10.9375 13.021 266.667 507.625
lsat 1006 5000 101.459 135.0 1331.15 2815.29
bones 33 422 74.375 84.709 390.834 385.166
mice 20 65 6.64575 8.06933 30.416 92.208
kidney 64 58 8.56967 11.479 66.2915 171.917
leuk 18 714 16.375 21.25 261.458 500.958
leukfr 40 714 23.0 29.0 269.188 601.083

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.1916 7.484 66.634 94.627
pumps 12 10 0.943733 1.16096 11.8775 6.75
dogs 2 720 NA NA 170.529 148.272
seeds 26 21 1.91 2.39283 31.899 20.268
surgical_realistic 14 12 1.22313 1.4362 15.158 8.54567
magnesium 108 96 10.409 11.8975 125.764 77.965
salm 22 18 2.32767 2.7872 22.122 12.6535
equiv 15 20 2.56391 3.42388 19.176 15.129
dyes 9 30 0.986655 1.1834 12.1775 13.1995
stacks 6 21 1.085 1.5108 22.622 14.837
epil 303 236 28.343 34.775 270.404 242.472
blockers 47 44 3.14811 3.494 56.806 28.704
oxford 244 240 13.795 16.14 349.773 168.795
lsat 1006 5000 155.39 195.575 1906.08 1452.09
bones 33 422 74.259 91.892 435.67 190.674
mice 20 65 7.30875 9.49433 29.475 37.77
kidney 64 58 11.0705 16.792 67.686 73.828
leuk 18 714 22.302 28.694 208.739 200.965
leukfr 40 714 25.859 33.272 239.241 230.059

@sunxd3
Copy link
Member

sunxd3 commented Jan 31, 2025

@naseweisssss are you able to merge this?

@naseweisssss
Copy link
Collaborator Author

@naseweisssss are you able to merge this?

The base branch restricts merging to authorized users. It says this

@naseweisssss naseweisssss merged commit da3f708 into master Jan 31, 2025
12 of 15 checks passed
@naseweisssss naseweisssss deleted the adding_node_type branch January 31, 2025 14: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.

3 participants