1
1
import tiny_solver
2
- from tiny_solver import GaussNewtonOptimizer , Problem , LinearSolver , OptimizerOptions , first_derivative_test
2
+ from tiny_solver import GaussNewtonOptimizer , Problem , LinearSolver , OptimizerOptions
3
3
from tiny_solver .factors import PriorFactor , BetweenFactorSE2 , PyFactor
4
4
from tiny_solver .loss_functions import HuberLoss
5
5
import numpy as np
@@ -19,42 +19,40 @@ def main():
19
19
print (f"{ tiny_solver .__version__ = } " )
20
20
print (dir (tiny_solver ))
21
21
22
- print (dir (LinearSolver .SparseCholesky ))
23
- opt_option = OptimizerOptions (linear_solver_type = LinearSolver .SparseQR , max_iteration = 12 , verbosity_level = 1 )
24
- print (opt_option )
25
- loss = HuberLoss (1.0 )
26
- print (loss )
27
- a = np .array ([1.0 , 2.0 ])
28
- # j = first_derivative_test(f, a)
29
- # print(j)
30
- a = PyFactor (f )
31
- a .call_func ()
32
- exit ()
33
- # print(tiny_solver.sum_as_string(1, 2))
34
-
35
- # tiny_solver.mult(np.zeros((1, 2)))
36
- # a = tiny_solver.Dual64()
37
- # print(a.first_derivative)
38
- b = BetweenFactorSE2 (1.0 , 2.0 , 3.0 )
39
- # print("factor module\n", dir(factors))
40
- # b = Costf(1.0, 2.0, 3.0)
41
-
42
- print (type (b ))
43
- print (dir (b ))
44
- print (b )
45
- problem = Problem ()
46
- print (dir (problem ))
47
- problem .num = 200
48
- print (problem .num )
49
- d = PriorFactor (np .array ([1.0 , 2.0 , 3.0 ]))
50
- problem .add_residual_block (1 , [("aa" , 1 )], d )
51
- problem .add_residual_block (1 , [("aaa" , 1 )], b )
52
- # c.add_residual_block(1, [("aaa", 1)])
53
- # c.add_residual_block(1, [("aa", 1)])
54
- # d = tiny_solver.BetweenFactor()
55
- # d.ttt()
56
- # tiny_solver.te(d)
57
- optimizer = GaussNewtonOptimizer ()
22
+ # print(dir(LinearSolver.SparseCholesky))
23
+ # opt_option = OptimizerOptions(linear_solver_type=LinearSolver.SparseQR, max_iteration=12, verbosity_level=1)
24
+ # print(opt_option)
25
+ # loss = HuberLoss(1.0)
26
+ # print(loss)
27
+ # a = np.array([1.0, 2.0])
28
+ # # j = first_derivative_test(f, a)
29
+ # # print(j)
30
+ # a = PyFactor(f)
31
+ # # print(tiny_solver.sum_as_string(1, 2))
32
+
33
+ # # tiny_solver.mult(np.zeros((1, 2)))
34
+ # # a = tiny_solver.Dual64()
35
+ # # print(a.first_derivative)
36
+ # b = BetweenFactorSE2(1.0, 2.0, 3.0)
37
+ # # print("factor module\n", dir(factors))
38
+ # # b = Costf(1.0, 2.0, 3.0)
39
+
40
+ # print(type(b))
41
+ # print(dir(b))
42
+ # print(b)
43
+ # problem = Problem()
44
+ # print(dir(problem))
45
+ # problem.num = 200
46
+ # print(problem.num)
47
+ # d = PriorFactor(np.array([1.0, 2.0, 3.0]))
48
+ # problem.add_residual_block(1, [("aa", 1)], d)
49
+ # problem.add_residual_block(1, [("aaa", 1)], b)
50
+ # # c.add_residual_block(1, [("aaa", 1)])
51
+ # # c.add_residual_block(1, [("aa", 1)])
52
+ # # d = tiny_solver.BetweenFactor()
53
+ # # d.ttt()
54
+ # # tiny_solver.te(d)
55
+ # optimizer = GaussNewtonOptimizer()
58
56
# optimizer.optimize(problem, {"aa": np.array([123, 2, 3, 4], dtype=np.float64)})
59
57
60
58
0 commit comments