File tree Expand file tree Collapse file tree 5 files changed +12
-9
lines changed Expand file tree Collapse file tree 5 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
name = " Turing"
2
2
uuid = " fce5fe82-541a-59a6-adf8-730c64b5f9a0"
3
- version = " 0.14.2 "
3
+ version = " 0.14.3 "
4
4
5
5
[deps ]
6
6
AbstractMCMC = " 80f14c24-f653-4e6a-9b94-39d6b0f70001"
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ getADbackend(spl::SampleFromPrior) = ADBackend()()
65
65
θ::AbstractVector{<:Real},
66
66
vi::VarInfo,
67
67
model::Model,
68
- sampler::AbstractSampler=SampleFromPrior(),
68
+ sampler::AbstractSampler,
69
+ ctx::DynamicPPL.AbstractContext = DynamicPPL.DefaultContext()
69
70
)
70
71
71
72
Computes the value of the log joint of `θ` and its gradient for the model
@@ -89,6 +90,7 @@ gradient_logp(
89
90
vi::VarInfo,
90
91
model::Model,
91
92
sampler::AbstractSampler = SampleFromPrior(),
93
+ ctx::DynamicPPL.AbstractContext = DynamicPPL.DefaultContext()
92
94
)
93
95
94
96
Compute the value of the log joint of `θ` and its gradient for the model
@@ -160,7 +162,7 @@ function gradient_logp(
160
162
# Specify objective function.
161
163
function f (θ)
162
164
new_vi = VarInfo (vi, sampler, θ)
163
- model (new_vi, sampler)
165
+ model (new_vi, sampler, context )
164
166
return getlogp (new_vi)
165
167
end
166
168
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ function gradient_logp(
27
27
# Specify objective function.
28
28
function f (θ)
29
29
new_vi = VarInfo (vi, sampler, θ)
30
- model (new_vi, sampler)
30
+ model (new_vi, sampler, context )
31
31
return getlogp (new_vi)
32
32
end
33
33
tp, result = taperesult (f, θ)
65
65
# Specify objective function.
66
66
function f (θ)
67
67
new_vi = VarInfo (vi, sampler, θ)
68
- model (new_vi, sampler)
68
+ model (new_vi, sampler, context )
69
69
return getlogp (new_vi)
70
70
end
71
71
ctp, result = memoized_taperesult (f, θ)
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ using NamedArrays
6
6
using ReverseDiff
7
7
using Random
8
8
using LinearAlgebra
9
+ using Zygote
9
10
10
11
dir = splitdir (splitdir (pathof (Turing))[1 ])[1 ]
11
12
include (dir* " /test/test_utils/AllUtils.jl" )
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ include("test_utils/AllUtils.jl")
40
40
@testset " variational algorithms : $adbackend " begin
41
41
include (" variational/advi.jl" )
42
42
end
43
+
44
+ @testset " modes" begin
45
+ include (" modes/ModeEstimation.jl" )
46
+ end
43
47
end
44
48
@testset " variational optimisers" begin
45
49
include (" variational/optimisers.jl" )
@@ -55,8 +59,4 @@ include("test_utils/AllUtils.jl")
55
59
# include("utilities/stan-interface.jl")
56
60
include (" inference/utilities.jl" )
57
61
end
58
-
59
- @testset " modes" begin
60
- include (" modes/ModeEstimation.jl" )
61
- end
62
62
end
You can’t perform that action at this time.
0 commit comments