@@ -12,35 +12,35 @@ import Mooncake
12
12
using Test: @test , @testset
13
13
using Turing
14
14
15
- @testset " Testing sghmc.jl with $adbackend " for adbackend in ADUtils . adbackends
15
+ @testset " Testing sghmc.jl" begin
16
16
@testset " sghmc constructor" begin
17
- alg = SGHMC (; learning_rate= 0.01 , momentum_decay= 0.1 , adtype= adbackend )
17
+ alg = SGHMC (; learning_rate= 0.01 , momentum_decay= 0.1 , adtype= Turing . DEFAULT_ADTYPE )
18
18
@test alg isa SGHMC
19
19
sampler = Turing. Sampler (alg)
20
20
@test sampler isa Turing. Sampler{<: SGHMC }
21
21
22
- alg = SGHMC (; learning_rate= 0.01 , momentum_decay= 0.1 , adtype= adbackend )
22
+ alg = SGHMC (; learning_rate= 0.01 , momentum_decay= 0.1 , adtype= Turing . DEFAULT_ADTYPE )
23
23
@test alg isa SGHMC
24
24
sampler = Turing. Sampler (alg)
25
25
@test sampler isa Turing. Sampler{<: SGHMC }
26
26
end
27
27
@testset " sghmc inference" begin
28
28
rng = StableRNG (123 )
29
29
30
- alg = SGHMC (; learning_rate= 0.02 , momentum_decay= 0.5 , adtype= adbackend )
30
+ alg = SGHMC (; learning_rate= 0.02 , momentum_decay= 0.5 , adtype= Turing . DEFAULT_ADTYPE )
31
31
chain = sample (rng, gdemo_default, alg, 10_000 )
32
32
check_gdemo (chain; atol= 0.1 )
33
33
end
34
34
end
35
35
36
- @testset " Testing sgld.jl with $adbackend " for adbackend in ADUtils . adbackends
36
+ @testset " Testing sgld.jl" begin
37
37
@testset " sgld constructor" begin
38
- alg = SGLD (; stepsize= PolynomialStepsize (0.25 ), adtype= adbackend )
38
+ alg = SGLD (; stepsize= PolynomialStepsize (0.25 ), adtype= Turing . DEFAULT_ADTYPE )
39
39
@test alg isa SGLD
40
40
sampler = Turing. Sampler (alg)
41
41
@test sampler isa Turing. Sampler{<: SGLD }
42
42
43
- alg = SGLD (; stepsize= PolynomialStepsize (0.25 ), adtype= adbackend )
43
+ alg = SGLD (; stepsize= PolynomialStepsize (0.25 ), adtype= Turing . DEFAULT_ADTYPE )
44
44
@test alg isa SGLD
45
45
sampler = Turing. Sampler (alg)
46
46
@test sampler isa Turing. Sampler{<: SGLD }
0 commit comments