Skip to content

Releases: TuringLang/JuliaBUGS.jl

JuliaBUGS-v0.11.1

02 Dec 09:47
d2865ad

Choose a tag to compare

JuliaBUGS JuliaBUGS-v0.11.1

Diff since JuliaBUGS-v0.11.0

Merged pull requests:

  • DoodleBUGS: Make zooming smooth (#360) (#384) (@Govindggupta)
  • Add DoodleBUGS PR Preview cleanup workflow (#387) (@Copilot)
  • Use dependence vectors to support generating Julia code for more models (#390) (@sunxd3)
  • DoodleBUGS: Implement Undo/Redo functionality (#398) (@kundangosavii)
  • CompatHelper: bump compat for JSON to 1 for package JuliaBUGS, (keep existing compat) (#399) (@github-actions[bot])
  • Use invokelatest in tests (because of Julia 1.12) (#404) (@sunxd3)
  • DoodleBUGS: fix Dependabot security alerts (#407) (@shravanngoswamii)
  • DoodleBUGS: Use PrimeVue for UI & Implement “Figma-like” Layout & Model Sharing Feature (#408) (@shravanngoswamii)
  • DoodleBUGS: fix sharing model with validation errors (#410) (@shravanngoswamii)
  • DoodleBUGS: Remove node only when Alt/Option (⌥) is pressed (#413) (@shravanngoswamii)

Closed issues:

  • Compile to JAX to enable GPU/TPU acceleration and vmap. (#209)
  • DoodleBUGS: Add GHA for PR Preview cleanup (#342)
  • DoodleBUGS: Backend (#355)
  • DoodleBUGS: Allow plate resizing (#358)
  • DoodleBUGS: Undo/Redo Functionality (#359)
  • DoodleBUGS: Make zooming smooth (#360)
  • JuliaBUGS: Plates not supported in plotting (#412)

JuliaBUGS-v0.11.0

19 Nov 16:56
0b9ead6

Choose a tag to compare

JuliaBUGS JuliaBUGS-v0.11.0

Diff since JuliaBUGS-v0.10.5

v0.11.0 Breaking Changes

Simplified sampling API in AbstractPPL.evaluate!!: Replaced sample_all and respect_observed (added in 0.10.5) kwargs with sample_observed.

Migration:

  • From 0.10.5: Default behavior unchanged (samples latents, keeps observed fixed)
    • sample_all=true, respect_observed=falsesample_observed=true
    • Other uses → remove (now default)
  • From 0.10.4 or earlier: Default behavior changed
    • Old default sampled all nodes including observed
    • New default keeps observed fixed; use sample_observed=true for old behavior

Merged pull requests:

  • Simplify sampling API: replace sample_all and respect_observed with sample_observed (#406) (@sunxd3)

JuliaBUGS-v0.10.5

17 Nov 08:19
43fdaac

Choose a tag to compare

JuliaBUGS JuliaBUGS-v0.10.5

Diff since JuliaBUGS-v0.10.4

Merged pull requests:

  • Add a kwarg to allow respecting observed values when sampling with evaluate_with_rng!! (#405) (@sunxd3)

JuliaBUGS-v0.10.4

07 Nov 11:35
870c2f1

Choose a tag to compare

JuliaBUGS JuliaBUGS-v0.10.4

Diff since JuliaBUGS-v0.10.3

Merged pull requests:

  • DoodleBUGS: Now works in WebKit broswers (Safari, all iPad/iOS browsers) (#402) (@shravanngoswamii)
  • Allow disabling source generation during compilation (#403) (@sunxd3)

Closed issues:

  • DoodleBUGS: Make it work for iPad (#350)
  • example 6 does not compile (#400)

JuliaBUGS-v0.10.3

23 Sep 12:40
53fd7bb

Choose a tag to compare

JuliaBUGS JuliaBUGS-v0.10.3

Diff since JuliaBUGS-v0.10.2

Merged pull requests:

  • Formatting some code and adjust formatting configs (#396) (@sunxd3)

JuliaBUGS-v0.10.2

09 Sep 13:14
61ed22d

Choose a tag to compare

JuliaBUGS JuliaBUGS-v0.10.2

Diff since JuliaBUGS-v0.10.1

Merged pull requests:

  • Fix typos, improve clarity and standardize spelling in documentation (#386) (@Copilot)
  • DoodleBUGS Project: Phase 2 (Backend) (#388) (@shravanngoswamii)
  • R interface for JuliaBUGS.jl from the rjuliabugs package (#389) (@MateusMaiaDS)
  • store manual layout and fix linting and typescript errors (#393) (@shravanngoswamii)
  • Add an argument to condition function to skip generating and evaling log density function (#394) (@sunxd3)

Closed issues:

  • Slice sampling within Gibbs (#185)
  • DoodleBUGS: Allow nested plates (#351)
  • DoodleBUGS: Implement two way highlighting (#352)
  • DoodleBUGS: Store Manual Layout (#361)
  • dead link in examples section (#391)

JuliaBUGS-v0.10.1

14 Aug 11:12
f868bba

Choose a tag to compare

Expose docs for changes in v0.10

Improvements and fixes:

  • Fixed Tagbot issues #377
  • Add tag_prefix option in Docs.yml so versioned docs gets deployed when Tagbot releases 977711a
  • Updated Documenter.jl version in for JuliaBUGS docs for support of tag_prefix option #378
  • Finally, explosed new docs files for v0.10

Auto-Generated Release Notes

What's Changed

Full Changelog: JuliaBUGS-v0.10.0...JuliaBUGS-v0.10.1

JuliaBUGS-v0.10.0

14 Aug 06:57

Choose a tag to compare

JuliaBUGS JuliaBUGS-v0.10.0

This is a major overhaul since v0.9.0. It introduces a faster evaluation mode, a refactored Gibbs sampler API, a new conditioning workflow, and a Turing-like modeling macro along with an ergonomic type system for model parameters.

Highlights

  • New evaluation mode: generated log-density function

    • Add UseGeneratedLogDensityFunction() and UseGraph() evaluation modes; switch with set_evaluation_mode(model, mode). Falls back to graph traversal when generation isn’t available.
    • Works in transformed (unconstrained) space only; call settrans(model, true) before enabling. If the model is untransformed, enabling the generated mode throws a helpful error.
    • Supported AD backends: Mooncake and Enzyme only, because the generated function mutates; other AD backends are not compatible with this mode for now.
    • Brings significant speedups on supported models; fixes cover conditioned models and discrete evaluation paths.
    • Related: #278, #276, #289, #279, #315, #318, #314.
  • Refactored Gibbs sampler and samplers API

    • New Gibbs API supports mapping variable groups to samplers via OrderedDict, with automatic expansion of subsuming variables (e.g., @varname(x) covers x[i]).
    • Gradient-based samplers now require an explicit AD backend passed as a tuple (sampler, ad_backend) (from ADTypes); the previous default wrapper approach was removed.
    • MHFromPrior was renamed/replaced by a clearer IndependentMH single-site sampler; supports standalone use and within Gibbs via gibbs_internal.
    • Uses AbstractMCMC.setparams!! to keep stateful samplers in sync during Gibbs updates; includes multi-threaded sampling tests.
    • Related: #320, #329, #330, #332.
  • Conditioning API overhaul (no subgraph creation)

    • condition(model, ...) now marks variables as observed in the same graph instead of creating a subgraph, and updates parameter sets accordingly. New decondition restores parameters and observation status.
    • Accepts Dict{VarName,Any}, Vector{VarName} (uses current values), or a NamedTuple for simple names; handles subsumption (e.g., x covers all x[i]) with diagnostics.
    • Related: #309, #314, #318, #313.
  • New modeling APIs: @model macro and of types

    • @model macro creates a model-generating function from a function definition. The first argument destructures stochastic parameters (; ...) and may carry an of type annotation to validate structure and shapes.
    • of and @of define type-level parameter specs with bounds, symbolic dimensions, and constants (e.g., @of(n=of(Int; constant=true), data=of(Array, n, 2))). These integrate with @model and provide helpers like zero(T) and instance construction T(; kwargs...).
    • Related: #291, #331.

Breaking changes

  • Gradient samplers must specify AD backend explicitly

    • Pass (HMC(...), AutoForwardDiff()), (NUTS(...), AutoReverseDiff()), or another ADTypes backend in the Gibbs map. The old default AD wrapper pattern was removed. (#330)
  • Renamed/updated MH sampler

    • Replace MHFromPrior() with IndependentMH(). Update Gibbs sampler maps accordingly. (#329)
  • Conditioning semantics and API

    • condition no longer constructs a subgraph; it mutates observation flags within a copy of the graph and returns a new BUGSModel. Use decondition(model) (or with specific variables) to restore. (#309, #314, #318)
  • Primitive registration macro rename

    • The macro to register custom callables for @bugs is now @bugs_primitive (replacing the old name in code). Adjust any usage accordingly.

New features

  • Generated evaluation mode: UseGeneratedLogDensityFunction() with set_evaluation_mode(model, ...) and settrans(model, ...) guards. (#278, #315, #318)
  • Turing-like @model macro that builds a compiled BUGSModel function; supports of type annotations on the destructured parameter arg. (#291)
  • of/@of type system for parameter specs with constants, bounds, symbolic dims, and convenient constructors/utilities. (#331)
  • IndependentMH sampler usable standalone or within Gibbs. (#329)
  • decondition(model[, vars]) to reverse conditioning. (#314)

Improvements and fixes

  • Model and evaluation

    • Fix and refine generated log-density for conditioned models; recursive handling of discrete computations; parameter sorting now includes only true model parameters. (#292, #289, #315, #318)
    • Refactor model internals into a Model module and move logdensityproblems integration there. (#306, #313)
    • Light refactors to BUGSModel and evaluation utilities. (#310, #314)
  • Graphs and utilities

    • Improve graphs.jl; remove legacy graph code; clarify imports and macro names. (#304, #323, #354)
  • Examples and docs

    • Add BUGSExamples Volume 3; update several example models and inter-op examples; README updates; clarify dmnorm usage notes. (#284, #277, #249, #369, #280)
  • Test, CI, and infra

    • Restructure tests; enable experimental tests; add test_args support; improve coverage and docs workflows; new folder layout. (#317, #365, #348, #295, #372, #373, #368)
  • Compatibility

    • Bump compat: AbstractPPL 0.11; AdvancedHMC [weakdeps] 0.7; JuliaSyntax 1; assorted package compat and Project.toml updates. (#282, #283, #287, #366, #367)

Usage notes and migration tips

  • Enabling the generated evaluation mode

    model = compile(@bugs begin
        # ...
    end, data)
    model = settrans(model, true)  # generated mode requires transformed space
    model = set_evaluation_mode(model, UseGeneratedLogDensityFunction())
    # falls back to UseGraph() automatically if generation isn’t supported
  • Gibbs with explicit AD backends for gradient samplers

    using ADTypes: AutoForwardDiff, AutoReverseDiff
    sampler_map = OrderedDict(
        @varname(μ) => (HMC(0.01, 10), AutoReverseDiff()),
        @varname(σ) => (NUTS(0.65), AutoForwardDiff()),
        @varname(k) => IndependentMH(),  # discrete or non-gradient
    )
    gibbs = Gibbs(model, sampler_map)
  • Conditioning and deconditioning

    using JuliaBUGS.Model: condition, decondition
    m1 = condition(model, Dict(@varname(x[1]) => 1.0, @varname(x[2]) => 2.0))
    m2 = decondition(m1)  # restore to the unconditioned parameterization
  • Defining models with @model and of

    RegressionParams = @of(
        y     = of(Array, 100),         # observed
        beta  = of(Array, 3),           # parameter
        sigma = of(Real, 0, nothing),   # parameter with lower bound
    )
    
    @model function regression((; y, beta, sigma)::RegressionParams, X, N)
        for i in 1:N
            mu[i] = X[i, :]  beta
            y[i] ~ dnorm(mu[i], sigma)
        end
        beta ~ dnorm(0, 0.001)
        sigma ~ dgamma(0.001, 0.001)
    end
    
    model = regression((; y = y_obs), X, N)

Additional notes

  • DoodleBUGS project (not part of this release): Substantial progress (Phase 1, code generation, data input, nested plates, exports, state persistence) and workflow isolation landed in this repo. These changes are present but out of scope for 0.10 and will be kept under a dedicated subfolder. See #339, #347, #357, #340, #341.

Thanks to everyone who contributed issues, PRs, reviews, and ideas across this cycle!

v0.9.0

27 Feb 15:25
46450d2

Choose a tag to compare

JuliaBUGS v0.9.0

Diff since v0.8.2

Breaking changes

  • With this release, the Julia compat version is bumped to 1.10.8 for JuliaBUGS (same as Bijectors v0.15.5)

Merged pull requests:

  • CompatHelper: bump compat for Bijectors to 0.15, (keep existing compat) (#242) (@github-actions[bot])
  • Update benchmarking code (#248) (@sunxd3)
  • CompatHelper: bump compat for AbstractPPL to 0.10, (keep existing compat) (#266) (@github-actions[bot])
  • CompatHelper: bump compat for GLMakie in [weakdeps] to 0.11, (keep existing compat) (#268) (@github-actions[bot])
  • Translating BUGSgraph to BayesianNetwork definition (#270) (@naseweisssss)
  • Modularising Bayesian Network (Experimental) (#271) (@naseweisssss)
  • Adding node type, and add back missing function (#272) (@naseweisssss)
  • Enable github action for experimental tests (#273) (@sunxd3)
  • Documentation and Turing Navigation CI improvement (#274) (@shravanngoswamii)

Closed issues:

  • [feature request] more robust serialization (#254)

v0.8.2

14 Dec 23:55
79235e9

Choose a tag to compare

JuliaBUGS v0.8.2

Diff since v0.8.1

Merged pull requests: