Skip to content

Bug Fixes and Easier Generative Models

Compare
Choose a tag to compare
@cpfiffer cpfiffer released this 04 Feb 15:26
· 909 commits to master since this release
  • Fixes a CmdStan overflow issue in TuringBenchmarks (#662)
  • Improved testing coverage for distributions (#621)
  • Added an upper bound on step size for HMC-based samplers (#659, #671)
  • Fixed an index parsing bug in the Chain type (#658)
  • Fixed IPMCMC sampler bug (#663)
  • Fixed automatic differentiation through nbinomlogpdf (#664)
  • Improved the API on the backend for HMC samplers (#671)
  • It's easier to draw from a prior now, so treating an existing Turing model as a generative one no longer requires a long list of default values in the model call (#644, #651). By passing in a Vector{Missing} object, the sampler will draw samples from the prior rather than the posterior. As an example:
# Import packages.
using Turing

# Define a simple Normal model with unknown mean and variance.
@model gdemo(x) = begin
    s ~ InverseGamma(2,3)
    m ~ Normal(0, sqrt(s))
    for i in eachindex(x)
        x[i] ~ Normal(m, sqrt(s))
    end
end

# Treat x as a vector of missing values.
model = gdemo(fill(missing, 2))
c = sample(model, HMC(500, 0.01, 5))