Skip to content

Commit 5cf43b2

Browse files
committed
Merge branch 'master' into mhauru/change-gibbs-sampler
2 parents a15ce2f + 2707d12 commit 5cf43b2

File tree

20 files changed

+1030
-343
lines changed

20 files changed

+1030
-343
lines changed

.github/workflows/Tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
- master
77
pull_request:
88

9+
# Cancel existing tests on the same PR if a new commit is added to a pull request
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
12+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
13+
914
jobs:
1015
test:
1116
# Use matrix.test.name here to avoid it taking up the entire window width

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Distributions = "0.23.3, 0.24, 0.25"
6363
DistributionsAD = "0.6"
6464
DocStringExtensions = "0.8, 0.9"
6565
DynamicHMC = "3.4"
66-
DynamicPPL = "0.30.4, 0.31"
66+
DynamicPPL = "0.32"
6767
EllipticalSliceSampling = "0.5, 1, 2"
6868
ForwardDiff = "0.10.3"
6969
Libtask = "0.8.8"

docs/src/api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ even though [`Prior()`](@ref) is actually defined in the `Turing.Inference` modu
3737

3838
### Modelling
3939

40-
| Exported symbol | Documentation | Description |
41-
|:--------------- |:--------------------------------- |:-------------------------------------------- |
42-
| `@model` | [`DynamicPPL.@model`](@extref) | Define a probabilistic model |
43-
| `@varname` | [`AbstractPPL.@varname`](@extref) | Generate a `VarName` from a Julia expression |
44-
| `@submodel` | [`DynamicPPL.@submodel`](@extref) | Define a submodel |
40+
| Exported symbol | Documentation | Description |
41+
|:--------------- |:----------------------------------- |:-------------------------------------------- |
42+
| `@model` | [`DynamicPPL.@model`](@extref) | Define a probabilistic model |
43+
| `@varname` | [`AbstractPPL.@varname`](@extref) | Generate a `VarName` from a Julia expression |
44+
| `to_submodel` | [`DynamicPPL.to_submodel`](@extref) | Define a submodel |
4545

4646
### Inference
4747

src/Turing.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,17 @@ using DynamicPPL:
7070
decondition,
7171
fix,
7272
unfix,
73-
conditioned
73+
conditioned,
74+
to_submodel
7475
using StatsBase: predict
7576
using Bijectors: ordered
7677
using OrderedCollections: OrderedDict
7778

7879
# Turing essentials - modelling macros and inference algorithms
7980
export @model, # modelling
8081
@varname,
81-
@submodel,
82+
@submodel, # Deprecated
83+
to_submodel,
8284
DynamicPPL,
8385
Prior, # Sampling from the prior
8486
MH, # classic sampling

src/mcmc/Inference.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ using DynamicPPL:
66
VarInfo,
77
TypedVarInfo,
88
islinked,
9-
invlink!,
10-
link!,
119
setindex!!,
1210
push!!,
1311
setlogp!!,

src/mcmc/hmc.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,12 @@ end
479479

480480
getstepsize(sampler::Sampler{<:Hamiltonian}, state) = sampler.alg.ϵ
481481
getstepsize(sampler::Sampler{<:AdaptiveHamiltonian}, state) = AHMC.getϵ(state.adaptor)
482+
function getstepsize(
483+
sampler::Sampler{<:AdaptiveHamiltonian},
484+
state::HMCState{TV,TKernel,THam,PhType,AHMC.Adaptation.NoAdaptation},
485+
) where {TV,TKernel,THam,PhType}
486+
return state.kernel.τ.integrator.ϵ
487+
end
482488

483489
gen_metric(dim::Int, spl::Sampler{<:Hamiltonian}, state) = AHMC.UnitEuclideanMetric(dim)
484490
function gen_metric(dim::Int, spl::Sampler{<:AdaptiveHamiltonian}, state)

test/Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[deps]
22
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
3+
AbstractPPL = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf"
34
AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
45
AdvancedPS = "576499cb-2369-40b2-a588-c64705576edc"
56
AdvancedVI = "b5ca4192-6429-45e5-a2d9-87aec30a685c"
67
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
8+
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
79
Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
810
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
911
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -46,15 +48,15 @@ Clustering = "0.14, 0.15"
4648
Distributions = "0.25"
4749
DistributionsAD = "0.6.3"
4850
DynamicHMC = "2.1.6, 3.0"
49-
DynamicPPL = "0.30.4, 0.31"
51+
DynamicPPL = "0.32.2"
5052
FiniteDifferences = "0.10.8, 0.11, 0.12"
5153
ForwardDiff = "0.10.12 - 0.10.32, 0.10"
5254
HypothesisTests = "0.11"
5355
LinearAlgebra = "1"
5456
LogDensityProblems = "2"
5557
LogDensityProblemsAD = "1.4"
5658
MCMCChains = "5, 6"
57-
Mooncake = "0.4.19"
59+
Mooncake = "0.4.61"
5860
NamedArrays = "0.9.4, 0.10"
5961
Optim = "1"
6062
Optimization = "3, 4"

0 commit comments

Comments
 (0)