From 2c9f83e939a9f85e7498ab4a06675b49c1753390 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Thu, 12 Sep 2019 19:39:31 +0200 Subject: [PATCH 1/2] removed inclusion of io.jl --- src/interface/Interface.jl | 4 ++-- src/utilities/Utilities.jl | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/interface/Interface.jl b/src/interface/Interface.jl index c0bc494ac..8f2ecb997 100644 --- a/src/interface/Interface.jl +++ b/src/interface/Interface.jl @@ -215,7 +215,7 @@ end ) Performs whatever initial setup is required for your sampler. This function is not intended -to return any value -- any set up should utate the sampler or the model type in-place. +to return any value -- any set up should mutate the sampler or the model type in-place. A common use for `sample_init!` might be to instantiate a particle field for later use, or find an initial step size for a Hamiltonian sampler. @@ -244,7 +244,7 @@ end ) Performs whatever finalizing the sampler requires. This function is not intended -to return any value -- any set up should utate the sampler or the model type in-place. +to return any value -- any set up should mutate the sampler or the model type in-place. `sample_end!` is useful in cases where you might like to perform some transformation on your vector of `AbstractTransitions`, save your sampler struct to disk, or otherwise diff --git a/src/utilities/Utilities.jl b/src/utilities/Utilities.jl index 2d3cda454..fc70a103b 100644 --- a/src/utilities/Utilities.jl +++ b/src/utilities/Utilities.jl @@ -17,6 +17,5 @@ export vectorize, include("helper.jl") include("robustinit.jl") -include("io.jl") # I/O end # module From d532ea09716db530e50410fc7fa8d71a555ed169 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Thu, 12 Sep 2019 20:31:31 +0200 Subject: [PATCH 2/2] fixes issue #906 --- src/inference/mh.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inference/mh.jl b/src/inference/mh.jl index acb0dd98b..e0517c9b2 100644 --- a/src/inference/mh.jl +++ b/src/inference/mh.jl @@ -146,7 +146,7 @@ function assume(spl::Sampler{<:MH}, dist::Distribution, vn::VarName, vi::VarInfo spl.state.proposal_ratio -= log(cdf(stdG, (ub-r)/σ) - cdf(stdG,(lb-r)/σ)) else # Other than Gaussian proposal r = rand(proposal) - if (r < support(dist).lb) | (r > support(dist).ub) # check if value lies in support + if !(insupport(dist, r)) # check if value lies in support spl.state.violating_support = true r = old_val end