Skip to content

Commit 801a76b

Browse files
committed
fix wrong usage of n_montecarlo in inference tests
1 parent 09c7276 commit 801a76b

6 files changed

+9
-15
lines changed

test/inference/repgradelbo_distributionsad.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ end
1515
[Float64, Float32],
1616
(modelname, modelconstr) in Dict(:Normal => normal_meanfield),
1717
(objname, objective) in Dict(
18-
:RepGradELBOClosedFormEntropy => RepGradELBO(n_montecarlo),
18+
:RepGradELBOClosedFormEntropy => RepGradELBO(10),
1919
:RepGradELBOStickingTheLanding =>
20-
RepGradELBO(n_montecarlo; entropy=StickingTheLandingEntropy()),
20+
RepGradELBO(10; entropy=StickingTheLandingEntropy()),
2121
),
2222
(adbackname, adtype) in AD_repgradelbo_distributionsad
2323

@@ -30,7 +30,6 @@ end
3030
T = 1000
3131
η = 1e-3
3232
opt = Optimisers.Descent(realtype(η))
33-
n_montecarlo = 10
3433

3534
# For small enough η, the error of SGD, Δλ, is bounded as
3635
# Δλ ≤ ρ^T Δλ0 + O(η),

test/inference/repgradelbo_locationscale.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ end
1616
(modelname, modelconstr) in
1717
Dict(:Normal => normal_meanfield, :Normal => normal_fullrank),
1818
(objname, objective) in Dict(
19-
:RepGradELBOClosedFormEntropy => RepGradELBO(n_montecarlo),
19+
:RepGradELBOClosedFormEntropy => RepGradELBO(10),
2020
:RepGradELBOStickingTheLanding =>
21-
RepGradELBO(n_montecarlo; entropy=StickingTheLandingEntropy()),
21+
RepGradELBO(10; entropy=StickingTheLandingEntropy()),
2222
),
2323
(adbackname, adtype) in AD_repgradelbo_locationscale
2424

@@ -31,7 +31,6 @@ end
3131
T = 1000
3232
η = 1e-3
3333
opt = Optimisers.Descent(realtype(η))
34-
n_montecarlo = 10
3534

3635
# For small enough η, the error of SGD, Δλ, is bounded as
3736
# Δλ ≤ ρ^T Δλ0 + O(η),

test/inference/repgradelbo_locationscale_bijectors.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ end
1616
(modelname, modelconstr) in
1717
Dict(:NormalLogNormalMeanField => normallognormal_meanfield),
1818
(objname, objective) in Dict(
19-
:RepGradELBOClosedFormEntropy => RepGradELBO(n_montecarlo),
19+
:RepGradELBOClosedFormEntropy => RepGradELBO(10),
2020
:RepGradELBOStickingTheLanding =>
21-
RepGradELBO(n_montecarlo; entropy=StickingTheLandingEntropy()),
21+
RepGradELBO(10; entropy=StickingTheLandingEntropy()),
2222
),
2323
(adbackname, adtype) in AD_repgradelbo_locationscale_bijectors
2424

@@ -31,7 +31,6 @@ end
3131
T = 1000
3232
η = 1e-3
3333
opt = Optimisers.Descent(realtype(η))
34-
n_montecarlo = 10
3534

3635
b = Bijectors.bijector(model)
3736
b⁻¹ = inverse(b)

test/inference/scoregradelbo_distributionsad.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ end
1414
@testset "$(modelname) $(objname) $(realtype) $(adbackname)" for realtype in
1515
[Float64, Float32],
1616
(modelname, modelconstr) in Dict(:Normal => normal_meanfield),
17-
(objname, objective) in Dict(:ScoreGradELBO => ScoreGradELBO(n_montecarlo)),
17+
(objname, objective) in Dict(:ScoreGradELBO => ScoreGradELBO(10)),
1818
(adbackname, adtype) in AD_scoregradelbo_distributionsad
1919

2020
seed = (0x38bef07cf9cc549d)
@@ -26,7 +26,6 @@ end
2626
T = 1000
2727
η = 1e-4
2828
opt = Optimisers.Descent(realtype(η))
29-
n_montecarlo = 10
3029

3130
# For small enough η, the error of SGD, Δλ, is bounded as
3231
# Δλ ≤ ρ^T Δλ0 + O(η),

test/inference/scoregradelbo_locationscale.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515
[Float64, Float32],
1616
(modelname, modelconstr) in
1717
Dict(:Normal => normal_meanfield, :Normal => normal_fullrank),
18-
(objname, objective) in Dict(:ScoreGradELBO => ScoreGradELBO(n_montecarlo)),
18+
(objname, objective) in Dict(:ScoreGradELBO => ScoreGradELBO(10)),
1919
(adbackname, adtype) in AD_scoregradelbo_locationscale
2020

2121
seed = (0x38bef07cf9cc549d)
@@ -27,7 +27,6 @@ end
2727
T = 1000
2828
η = 1e-4
2929
opt = Optimisers.Descent(realtype(η))
30-
n_montecarlo = 10
3130

3231
# For small enough η, the error of SGD, Δλ, is bounded as
3332
# Δλ ≤ ρ^T Δλ0 + O(η),

test/inference/scoregradelbo_locationscale_bijectors.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515
[Float64, Float32],
1616
(modelname, modelconstr) in
1717
Dict(:NormalLogNormalMeanField => normallognormal_meanfield),
18-
(objname, objective) in Dict(:ScoreGradELBO => ScoreGradELBO(n_montecarlo)),
18+
(objname, objective) in Dict(:ScoreGradELBO => ScoreGradELBO(10)),
1919
(adbackname, adtype) in AD_scoregradelbo_locationscale_bijectors
2020

2121
seed = (0x38bef07cf9cc549d)
@@ -27,7 +27,6 @@ end
2727
T = 1000
2828
η = 1e-4
2929
opt = Optimisers.Descent(realtype(η))
30-
n_montecarlo = 10
3130

3231
b = Bijectors.bijector(model)
3332
b⁻¹ = inverse(b)

0 commit comments

Comments
 (0)