@@ -42,23 +42,25 @@ include("oed_utils.jl")
42
42
43
43
44
44
m = 50
45
+ n = Int (floor (m / 10 ))
45
46
verbose = true
46
47
47
48
# # A-Optimal Design Problem
48
49
@testset " A-Optimal Design" begin
49
50
50
- Ex_mat, n, N, ub = build_data (m)
51
+ Ex_mat, N, ub = build_data (m, n )
51
52
52
53
g, grad! = build_a_criterion (Ex_mat, build_safe= false )
53
54
blmo = build_blmo (m, N, ub)
54
55
heu = Boscia. Heuristic (Boscia. rounding_hyperplane_heuristic, 0.7 , :hyperplane_aware_rounding )
55
56
domain_oracle = build_domain_oracle (Ex_mat, n)
57
+ domain_point = build_domain_point_function (domain_oracle, Ex_mat, N, collect (1 : m), fill (0.0 , m), ub)
56
58
57
59
# precompile
58
60
line_search = FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
59
61
x0, active_set = build_start_point (Ex_mat, N, ub)
60
62
z = greedy_incumbent (Ex_mat, N, ub)
61
- x, _, _ = Boscia. solve (g, grad!, blmo, active_set= active_set, start_solution= z, time_limit= 10 , verbose= false , domain_oracle= domain_oracle, custom_heuristics= [heu], line_search= line_search)
63
+ x, _, _ = Boscia. solve (g, grad!, blmo, active_set= active_set, start_solution= z, time_limit= 10 , verbose= false , domain_oracle= domain_oracle, find_domain_point = domain_point, custom_heuristics= [heu], line_search= line_search)
62
64
63
65
# proper run with MGLS and Adaptive
64
66
line_search = FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
@@ -72,6 +74,7 @@ verbose = true
72
74
start_solution= z,
73
75
verbose= verbose,
74
76
domain_oracle= domain_oracle,
77
+ find_domain_point= domain_point,
75
78
custom_heuristics= [heu],
76
79
line_search= line_search,
77
80
)
@@ -89,29 +92,31 @@ verbose = true
89
92
start_solution= z,
90
93
verbose= verbose,
91
94
domain_oracle= domain_oracle,
95
+ find_domain_point= domain_point,
92
96
custom_heuristics= [heu],
93
97
line_search= line_search,
94
98
)
95
99
96
- @test result_s[:dual_bound ] <= g (x) + 1e-4
97
- @test result[:dual_bound ] <= g (x_s) + 1e-4
100
+ @test result_s[:dual_bound ] <= g (x) + 1e-3
101
+ @test result[:dual_bound ] <= g (x_s) + 1e-3
98
102
@test isapprox (g (x), g (x_s), atol= 1e-3 )
99
103
end
100
104
101
105
# # D-Optimal Design Problem
102
106
@testset " D-optimal Design" begin
103
- Ex_mat, n, N, ub = build_data (m)
107
+ Ex_mat, N, ub = build_data (m, n )
104
108
105
109
g, grad! = build_d_criterion (Ex_mat, build_safe= false )
106
110
blmo = build_blmo (m, N, ub)
107
111
heu = Boscia. Heuristic (Boscia. rounding_hyperplane_heuristic, 0.7 , :hyperplane_aware_rounding )
108
112
domain_oracle = build_domain_oracle (Ex_mat, n)
113
+ domain_point = build_domain_point_function (domain_oracle, Ex_mat, N, collect (1 : m), fill (0.0 , m), ub)
109
114
110
115
# precompile
111
116
line_search = FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
112
117
x0, active_set = build_start_point (Ex_mat, N, ub)
113
118
z = greedy_incumbent (Ex_mat, N, ub)
114
- x, _, _ = Boscia. solve (g, grad!, blmo, active_set= active_set, start_solution= z, time_limit= 10 , verbose= false , domain_oracle= domain_oracle, custom_heuristics= [heu], line_search= line_search)
119
+ x, _, _ = Boscia. solve (g, grad!, blmo, active_set= active_set, start_solution= z, time_limit= 10 , verbose= false , domain_oracle= domain_oracle, find_domain_point = domain_point, custom_heuristics= [heu], line_search= line_search)
115
120
116
121
# proper run with MGLS and Adaptive
117
122
line_search = FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
125
130
start_solution= z,
126
131
verbose= verbose,
127
132
domain_oracle= domain_oracle,
133
+ find_domain_point= domain_point,
128
134
custom_heuristics= [heu],
129
135
line_search= line_search,
130
136
)
142
148
start_solution= z,
143
149
verbose= verbose,
144
150
domain_oracle= domain_oracle,
151
+ find_domain_point= domain_point,
145
152
custom_heuristics= [heu],
146
153
line_search= line_search,
147
154
)
0 commit comments