Skip to content

Commit 5b5c205

Browse files
committed
Update Turing folder (#204)
1 parent 9d4280c commit 5b5c205

File tree

14 files changed

+487
-987
lines changed

14 files changed

+487
-987
lines changed

test/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
33
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
44
AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
5+
AdvancedPS = "576499cb-2369-40b2-a588-c64705576edc"
56
AdvancedVI = "b5ca4192-6429-45e5-a2d9-87aec30a685c"
67
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
78
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
@@ -35,13 +36,14 @@ ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
3536
AbstractMCMC = "2.1"
3637
AdvancedHMC = "0.2.25"
3738
AdvancedMH = "0.5.2"
39+
AdvancedPS = "0.1"
3840
AdvancedVI = "0.1"
3941
BangBang = "0.3"
4042
Bijectors = "0.8.2"
4143
Distributions = "0.23.8, 0.24"
4244
DistributionsAD = "0.6.3"
4345
DocStringExtensions = "0.8.2"
44-
EllipticalSliceSampling = "0.3"
46+
EllipticalSliceSampling = "0.4"
4547
ForwardDiff = "0.10.12"
4648
Libtask = "0.4.1, 0.5"
4749
LogDensityProblems = "0.10.3"

test/Turing/Turing.jl

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,20 @@ using Tracker: Tracker
1717

1818
import AdvancedVI
1919
import DynamicPPL: getspace, NoDist, NamedDist
20+
import Random
2021

2122
const PROGRESS = Ref(true)
22-
function turnprogress(switch::Bool)
23-
@info "[Turing]: progress logging is $(switch ? "enabled" : "disabled") globally"
24-
PROGRESS[] = switch
25-
AdvancedVI.turnprogress(switch)
23+
24+
"""
25+
setprogress!(progress::Bool)
26+
27+
Enable progress logging in Turing if `progress` is `true`, and disable it otherwise.
28+
"""
29+
function setprogress!(progress::Bool)
30+
@info "[Turing]: progress logging is $(progress ? "enabled" : "disabled") globally"
31+
PROGRESS[] = progress
32+
AdvancedVI.turnprogress(progress)
33+
return progress
2634
end
2735

2836
# Random probability measures.
@@ -82,6 +90,7 @@ export @model, # modelling
8290
Emcee,
8391
ESS,
8492
Gibbs,
93+
GibbsConditional,
8594

8695
HMC, # Hamiltonian-like sampling
8796
SGLD,
@@ -109,7 +118,7 @@ export @model, # modelling
109118
setadbackend,
110119
setadsafe,
111120

112-
turnprogress, # debugging
121+
setprogress!, # debugging
113122

114123
Flat,
115124
FlatPos,
@@ -123,7 +132,8 @@ export @model, # modelling
123132

124133
predict,
125134
pointwise_loglikelihoods,
126-
genereated_quantities,
135+
elementwise_loglikelihoods,
136+
generated_quantities,
127137
logprior,
128138
logjoint
129139
end

0 commit comments

Comments
 (0)