Skip to content

Commit 26893f4

Browse files
authored
Explain how to set up SDPLRPlus to be closer to SDPLR (#58)
1 parent 72af765 commit 26893f4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

examples/holy.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,22 @@ solve_time(lr)
121121
# and exploit the fact that the lagrangian is a degree-4 polynomial to streamline
122122
# the linesearch.
123123
# We need to use `square_scalars` as SDPLRPlus only supports free variables.
124+
# The default value of SDPLR for `rho_f` is `1e-5`. In SDPLRPlus
125+
# the corresponding setting is `ptol` so we set it `1e-5` as well.
126+
# SDPLRPlus also checks the duality gap to automatically update the rank.
127+
# We can disable this by setting `objtol` to `Inf`
128+
# Since we set the `objtol` to `Inf`, no need to find a trace bound to set
129+
# to `prior_trace_bound`
124130

125131
import SDPLRPlus
126132
set_optimizer(cl, dual_optimizer(LRO.Optimizer))
127133
set_attribute(cl, "solver", LRO.BurerMonteiro.Solver)
128134
set_attribute(cl, "sub_solver", SDPLRPlus.Solver)
129135
set_attribute(cl, "ranks", [15])
130-
set_attribute(cl, "maxmajoriter", 5)
136+
set_attribute(lr, "ptol", 1e-5)
137+
set_attribute(lr, "objtol", Inf)
138+
set_attribute(lr, "maxmajoriter", 100)
131139
set_attribute(cl, "square_scalars", true)
132-
set_attribute(cl, "prior_trace_bound", 10.0)
133140
optimize!(cl)
134141

135142
# We can speed it up with sparse low-rank constraints:
@@ -138,9 +145,10 @@ set_optimizer(lr, dual_optimizer(LRO.Optimizer))
138145
set_attribute(lr, "solver", LRO.BurerMonteiro.Solver)
139146
set_attribute(lr, "sub_solver", SDPLRPlus.Solver)
140147
set_attribute(lr, "ranks", [15])
148+
set_attribute(lr, "ptol", 1e-5)
149+
set_attribute(lr, "objtol", Inf)
141150
set_attribute(lr, "maxmajoriter", 100)
142151
set_attribute(lr, "square_scalars", true)
143-
set_attribute(lr, "prior_trace_bound", 10.0)
144152
optimize!(lr)
145153
termination_status(lr)
146154
objective_value(lr)

0 commit comments

Comments
 (0)