Releases: TuringLang/Turing.jl
PMMH Bugfix
This release fixes the PMMH
and PIMH
samplers, which needed adjustment after the recent compiler refactor (see #613 for more details). Additionally, much of the internal organization has changed in preparation of future improved type stability while sampling.
Fixed DynamicHMC support and related issues.
v0.6.5 Updated doc for DynamicHMC.
Compiler Refactoring
Much of the back end of how Turing interprets models has changed with the merge of #613. See that issue for more detail.
Summary of changes
- Models can now have default values in arguments (#544 (comment)). When an argument is not provided, it is treated as a parameter instead of an observation and is instantiated to its default value. The snippet below shows how
x
will be instantiated withdefault_x
when no value is provided.
@model model_function(x = default_x, y)
...
end
Improving AD type stability.
This release improves the type stability of automatic differentiation. For more details, see #626. Speeds should be slightly increased across all samplers, though Gibbs
sampling experienced a fairly significant performance boost (source).
You can now specify different autodiff methods for each variable. The snippet below shows using ForwardDiff to sample the mean (m
) parameter, and using the Flux-based autodiff for the variance (s
) parameter:
using Turing
# Define a simple Normal model with unknown mean and variance.
@model gdemo(x, y) = begin
s ~ InverseGamma(2, 3)
m ~ Normal(0, sqrt(s))
x ~ Normal(m, sqrt(s))
y ~ Normal(m, sqrt(s))
return s, m
end
c = sample(gdemo(1.5, 2), Gibbs(1000,
HMC{Turing.ForwardDiffAD{1}}(2, 0.1, 5, :m),
HMC{Turing.FluxTrackerAD}(2, 0.1, 5, :s)))
Fixed some AD issues.
Fix and add more AD tests (#625) * add binomlogpdf ForwardDiff.Dual workaround * fix broken AD tests and add some more * remove FDM from REQUIRE
Make default adaptation numerical stable
Improve numerical stability (#619) * remove unnecessary lower bound check * make default precond to diagonal * add numerical stable Binomial with logit * fix DA complete adapt * add test of BinomialLogit * turn off pre-cond adapt by default
Changed AD default backend to ForwardDiff.
Improve numerical stability (#619) * remove unnecessary lower bound check * make default precond to diagonal * add numerical stable Binomial with logit * fix DA complete adapt * add test of BinomialLogit * turn off pre-cond adapt by default
Fixed some adaption issues in HMC/NUTS.
Merge pull request #610 from TuringLang/ChrisRackauckas-patch-1 Update REQUIRE
Fixed an issue with broadcasting in VarInfo.
v0.5.1 Merge branch 'master' of https://github.com/TuringLang/Turing.jl