Skip to content

Commit 1079c13

Browse files
committed
Remove more tests
1 parent f812c69 commit 1079c13

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

test/dynamicppl/varinfo.jl

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,10 @@ using Turing
170170
chain = sample(marr_name_test(), HMC(0.2, 4), 1000)
171171
check_numerical(chain, ["p[1][1]"], [0]; atol=0.25)
172172
end
173+
173174
@testset "varinfo" begin
174175
dists = [Normal(0, 1), MvNormal(zeros(2), I), Wishart(7, [1 0.5; 0.5 1])]
175176
function test_varinfo!(vi)
176-
@test DynamicPPL.getlogp(vi) === 0.0
177-
vi = DynamicPPL.setlogp!!(vi, 1)
178-
@test DynamicPPL.getlogp(vi) === 1.0
179-
vi = DynamicPPL.acclogp!!(vi, 1)
180-
@test DynamicPPL.getlogp(vi) === 2.0
181-
vi = DynamicPPL.resetlogp!!(vi)
182-
@test DynamicPPL.getlogp(vi) === 0.0
183-
184177
spl2 = DynamicPPL.Sampler(PG(5, :w, :u), empty_model())
185178
vn_w = @varname w
186179
randr(vi, vn_w, dists[1], spl2, true)
@@ -227,48 +220,6 @@ using Turing
227220
vi = DynamicPPL.VarInfo()
228221
test_varinfo!(vi)
229222
test_varinfo!(empty!!(DynamicPPL.TypedVarInfo(vi)))
230-
231-
@model igtest() = begin
232-
x ~ InverseGamma(2, 3)
233-
y ~ InverseGamma(2, 3)
234-
z ~ InverseGamma(2, 3)
235-
w ~ InverseGamma(2, 3)
236-
u ~ InverseGamma(2, 3)
237-
end
238-
239-
# Test the update of group IDs
240-
g_demo_f = igtest()
241-
end
242-
243-
@testset "Turing#2151: eltype(vi, spl)" begin
244-
# build data
245-
t = 1:0.05:8
246-
σ = 0.3
247-
y = @. rand(sin(t) + Normal(0, σ))
248-
249-
@model function state_space(y, TT, ::Type{T}=Float64) where {T}
250-
# Priors
251-
α ~ Normal(y[1], 0.001)
252-
τ ~ Exponential(1)
253-
η ~ filldist(Normal(0, 1), TT - 1)
254-
σ ~ Exponential(1)
255-
256-
# create latent variable
257-
x = Vector{T}(undef, TT)
258-
x[1] = α
259-
for t in 2:TT
260-
x[t] = x[t - 1] + η[t - 1] * τ
261-
end
262-
263-
# measurement model
264-
y ~ MvNormal(x, σ^2 * I)
265-
266-
return x
267-
end
268-
269-
n = 10
270-
model = state_space(y, length(t))
271-
@test size(sample(model, NUTS(; adtype=AutoReverseDiff(; compile=true)), n), 1) == n
272223
end
273224
end
274225

0 commit comments

Comments
 (0)