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

Ancestral Sampling and Bayes Ball Algorithm #233

Merged
merged 35 commits into from
Nov 21, 2024

Commits on Nov 4, 2024

  1. change SimpleGraph to SimpleDiGraph for topological sort and added te…

    …st for ancestral sampling
    naseweisssss committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    304fd88 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    573b3e5 View commit details
    Browse the repository at this point in the history
  3. Update src/experimental/ProbabilisticGraphicalModels/bayesnet.jl

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 4, 2024
    Configuration menu
    Copy the full SHA
    62c07ed View commit details
    Browse the repository at this point in the history
  4. Update src/experimental/ProbabilisticGraphicalModels/bayesnet.jl

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 4, 2024
    Configuration menu
    Copy the full SHA
    344b4f1 View commit details
    Browse the repository at this point in the history
  5. Update test/experimental/ProbabilisticGraphicalModels/bayesnet.jl

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 4, 2024
    Configuration menu
    Copy the full SHA
    0bb810a View commit details
    Browse the repository at this point in the history
  6. Update test/experimental/ProbabilisticGraphicalModels/bayesnet.jl

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 4, 2024
    Configuration menu
    Copy the full SHA
    6ce7559 View commit details
    Browse the repository at this point in the history
  7. Update test/experimental/ProbabilisticGraphicalModels/bayesnet.jl

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 4, 2024
    Configuration menu
    Copy the full SHA
    c385c37 View commit details
    Browse the repository at this point in the history
  8. Apply suggestions from code review

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 4, 2024
    Configuration menu
    Copy the full SHA
    1d0ed43 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. add more complex tests

    naseweisssss committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    bc2fccf View commit details
    Browse the repository at this point in the history
  2. Apply suggestions from code review

    linting
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 5, 2024
    Configuration menu
    Copy the full SHA
    102069d View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. add wrapper functions

    naseweisssss committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    503910f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    593d18e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6f2bbcf View commit details
    Browse the repository at this point in the history
  4. linting

    naseweisssss committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    8ffba3b View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2024

  1. Configuration menu
    Copy the full SHA
    2c91dac View commit details
    Browse the repository at this point in the history
  2. formatting

    sunxd3 committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    8339b0e View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2024

  1. Configuration menu
    Copy the full SHA
    25308ff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    35c1c3f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1a83c12 View commit details
    Browse the repository at this point in the history
  4. formatting

    naseweisssss committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    c387813 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2024

  1. temporary pass test

    naseweisssss committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    deaf99c View commit details
    Browse the repository at this point in the history
  2. formatting

    naseweisssss committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    830c208 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2024

  1. Configuration menu
    Copy the full SHA
    cae8914 View commit details
    Browse the repository at this point in the history
  2. Apply suggestions from code review

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    naseweisssss and github-actions[bot] authored Nov 17, 2024
    Configuration menu
    Copy the full SHA
    966e4d1 View commit details
    Browse the repository at this point in the history
  3. Improve show function of BUGSModel (#236)

    sunxd3 authored and naseweisssss committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    f9347bc View commit details
    Browse the repository at this point in the history
  4. Permit dot call (like Distributions.Normal) to be used in model def…

    …inition (#237)
    
    The motivation for the PR is initially to allow the use
    [`product_distribution`](https://juliastats.org/Distributions.jl/stable/multivariate/#Distributions.product_distribution)
    in JuliaBUGS model. By writing
    
    ```julia
    @bugs begin
        x[1:2] ~ Distributions.product_distribution(fill(Normal(), 2))
    end
    ```
    
    It also enables
    
    ```julia
    julia> foo(x) = x + 1
    foo (generic function with 1 method)
    
    julia> model_def = @bugs begin
               a = Main.foo(b)
           end
    quote
        a = Main.foo(b)
    end
    
    julia> compile(model_def, (;b=2))
    BUGSModel (parameters are in transformed (unconstrained) space, with dimension 0):
    
      Model parameters:
    
      Variable sizes and types:
        a: type = Int64
        b: type = Int64
    ```
    
    i.e., an easier way to introduce external functions into JuliaBUGS. 
    
    This can't fully replace `@register_primitive` yet, because using `Main`
    module is relying on Julia runtime behavior and not very intuitive.
    Examples:
    
    ```julia
    julia> module TestModule
               bar(x) = x + 1
           end
    Main.TestModule
    
    julia> model_def = @bugs begin
               a = TestModule.bar(b)
           end
    quote
        a = TestModule.bar(b)
    end
    
    julia> compile(model_def, (; b = 1))
    ERROR: UndefVarError: `TestModule` not defined in `JuliaBUGS`
    ...
    ```
    
    one would need to do 
    
    ```julia
    julia> model_def = @bugs begin
               a = Main.TestModule.bar(b)
           end
    quote
        a = Main.TestModule.bar(b)
    end
    ```
    
    also
    
    ```julia
    julia> @testset "t" begin
               foo1(x) = x + 1
               model_def = @bugs begin
                   a = Main.foo1(b)
               end
               compile(model_def, (; b= 1))
           end
    t: Error During Test at REPL[18]:1
      Got exception outside of a @test
      UndefVarError: `foo1` not defined in `Main`
    ...
    ```
    sunxd3 authored and naseweisssss committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    a4cbbba View commit details
    Browse the repository at this point in the history
  5. remove comments

    naseweisssss committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    1ca9933 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2024

  1. Configuration menu
    Copy the full SHA
    e229cac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    34a17b2 View commit details
    Browse the repository at this point in the history
  3. remove VE

    naseweisssss committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    0921f2e View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2024

  1. Configuration menu
    Copy the full SHA
    43027c5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a0ea8e9 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. fix formating

    sunxd3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    a318f60 View commit details
    Browse the repository at this point in the history
  2. formatting

    sunxd3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    121d412 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0cff1db View commit details
    Browse the repository at this point in the history