Skip to content

Commit f81d5ea

Browse files
committed
update test tolerances
1 parent 21ad57d commit f81d5ea

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

test/manifolds/manifolddiff.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ end
9292
##
9393

9494
sol = Optim.optimize(f, g!, x0, Optim.ConjugateGradient(; manifold=ManifoldWrapper(M)))
95-
@test isapprox([0,1,0.], sol.minimizer; atol=1e-8)
95+
@test isapprox([0,1,0.], sol.minimizer; atol=1e-6)
9696

9797

9898
## finitediff gradient (non-manual)
@@ -106,7 +106,7 @@ end
106106
x0 = [1.0, 0.0, 0.0]
107107

108108
sol = Optim.optimize(f, g_FD!, x0, Optim.ConjugateGradient(; manifold=ManifoldWrapper(M)))
109-
@test isapprox([0,1,0.], sol.minimizer; atol=1e-8)
109+
@test isapprox([0,1,0.], sol.minimizer; atol=1e-6)
110110

111111
##
112112

@@ -161,7 +161,7 @@ Cq .= randn(3)
161161
# Cq[
162162
@show sol.minimizer
163163
@test isapprox( f(sol.minimizer), 0; atol=1e-3 )
164-
@test isapprox( 0, sum(abs.(log(M, e0, compose(M, inv(M,q), sol.minimizer)))); atol=1e-5)
164+
@test isapprox( 0, sum(abs.(log(M, e0, compose(M, inv(M,q), sol.minimizer)))); atol=1e-3)
165165

166166
##
167167
end
@@ -193,7 +193,7 @@ g_FD!(X, q)
193193

194194
@show X_ = [X.x[1][:]; X.x[2][:]]
195195
# gradient at the optimal point should be zero
196-
@test isapprox(0, sum(abs.(X_)); atol=1e-8 )
196+
@test isapprox(0, sum(abs.(X_)); atol=1e-6 )
197197

198198
# gradient not the optimal point should be non-zero
199199
g_FD!(X, e0)
@@ -230,7 +230,7 @@ sol = IncrementalInference.optimizeManifold_FD(M,f,x0)
230230

231231
@show sol.minimizer
232232
@test isapprox( f(sol.minimizer), 0; atol=1e-3 )
233-
@test isapprox( 0, sum(abs.(log(M, e0, compose(M, inv(M,q), sol.minimizer)))); atol=1e-4)
233+
@test isapprox( 0, sum(abs.(log(M, e0, compose(M, inv(M,q), sol.minimizer)))); atol=1e-3)
234234

235235

236236
##

test/testBasicParametric.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ for i in 0:10
139139
sym = Symbol("x",i)
140140
var = getVariable(fg,sym)
141141
@show val = var.solverDataDict[:parametric].val
142-
@test isapprox(val[1][1], i, atol=1e-4)
143-
@test isapprox(val[1][2], i, atol=1e-4)
142+
@test isapprox(val[1][1], i, atol=1e-3)
143+
@test isapprox(val[1][2], i, atol=1e-3)
144144
end
145145

146146
##
@@ -179,9 +179,9 @@ foreach(fct->println(fct.label, ": ", getFactorType(fct).Z), getFactors(fg))
179179
d,st,vs,Σ = IIF.solveGraphParametric(fg)
180180

181181
foreach(println, d)
182-
@test isapprox(d[:x0].val[1][1], -0.01, atol=1e-4)
183-
@test isapprox(d[:x1].val[1][1], 0.0, atol=1e-4)
184-
@test isapprox(d[:x2].val[1][1], 0.01, atol=1e-4)
182+
@test isapprox(d[:x0].val[1][1], -0.01, atol=1e-3)
183+
@test isapprox(d[:x1].val[1][1], 0.0, atol=1e-3)
184+
@test isapprox(d[:x2].val[1][1], 0.01, atol=1e-3)
185185

186186

187187
##
@@ -202,9 +202,9 @@ tree2 = solveTree!(fg; algorithm=:parametric, eliminationOrder=[:x0, :x2, :x1])
202202
# end
203203
foreach(v->println(v.label, ": ", DFG.getSolverData(v, :parametric).val), getVariables(fg))
204204

205-
@test isapprox(getVariable(fg,:x0).solverDataDict[:parametric].val[1][1], -0.01, atol=1e-4)
206-
@test isapprox(getVariable(fg,:x1).solverDataDict[:parametric].val[1][1], 0.0, atol=1e-4)
207-
@test isapprox(getVariable(fg,:x2).solverDataDict[:parametric].val[1][1], 0.01, atol=1e-4)
205+
@test isapprox(getVariable(fg,:x0).solverDataDict[:parametric].val[1][1], -0.01, atol=1e-3)
206+
@test isapprox(getVariable(fg,:x1).solverDataDict[:parametric].val[1][1], 0.0, atol=1e-3)
207+
@test isapprox(getVariable(fg,:x2).solverDataDict[:parametric].val[1][1], 0.01, atol=1e-3)
208208

209209
## ##############################################################################
210210
## multiple sections

0 commit comments

Comments
 (0)