ReactiveBayes / RxInfer.jl

Julia package for automated Bayesian inference on a factor graph with reactive message passing
MIT License
259 stars 24 forks source link

#9:`make_node` accepts all data-/constvars #67

Closed wmkouw closed 1 year ago

wmkouw commented 1 year ago

Added make_node method that allows for inline functions applied to datavariables, such as:

@model function sum_datavars_as_gaussian_mean_2()
    a = datavar(Float64)
    b = datavar(Float64)
    c = constvar(0.0)
    y = datavar(Float64)

    x ~ Normal(mean = (a + b) + c, variance = 1.0)
    y ~ Normal(mean = x, variance = 1.0)
end

where two hidden intermediate datavariables are constructed from #1 = a+b and #2 = #1 + c respectively.

closes #9

codecov-commenter commented 1 year ago

Codecov Report

Base: 79.70% // Head: 79.88% // Increases project coverage by +0.17% :tada:

Coverage data is based on head (d4e93ca) compared to base (df06f80). Patch coverage: 100.00% of modified lines in pull request are covered.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #67 +/- ## ========================================== + Coverage 79.70% 79.88% +0.17% ========================================== Files 11 11 Lines 1163 1173 +10 ========================================== + Hits 927 937 +10 Misses 236 236 ``` | [Impacted Files](https://codecov.io/gh/biaslab/RxInfer.jl/pull/67?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biaslab) | Coverage Δ | | |---|---|---| | [src/inference.jl](https://codecov.io/gh/biaslab/RxInfer.jl/pull/67?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biaslab#diff-c3JjL2luZmVyZW5jZS5qbA==) | `74.80% <100.00%> (ø)` | | | [src/model.jl](https://codecov.io/gh/biaslab/RxInfer.jl/pull/67?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biaslab#diff-c3JjL21vZGVsLmps) | `85.71% <100.00%> (+0.79%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biaslab). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biaslab)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.