1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-28 11:05:28 +01:00
PropertyT.jl/test/optimizers.jl

53 lines
1.2 KiB
Julia
Raw Normal View History

2022-11-07 18:45:12 +01:00
## Optimizers
import JuMP
import SCS
function scs_optimizer(;
2023-03-19 20:33:28 +01:00
accel = 10,
alpha = 1.5,
eps = 1e-9,
max_iters = 100_000,
verbose = true,
linear_solver = SCS.DirectSolver,
2022-11-07 18:45:12 +01:00
)
return JuMP.optimizer_with_attributes(
SCS.Optimizer,
"acceleration_lookback" => accel,
"acceleration_interval" => 10,
"alpha" => alpha,
"eps_abs" => eps,
"eps_rel" => eps,
"linear_solver" => linear_solver,
"max_iters" => max_iters,
"warm_start" => true,
"verbose" => verbose,
)
end
import COSMO
function cosmo_optimizer(;
2023-03-19 20:33:28 +01:00
accel = 15,
alpha = 1.6,
eps = 1e-9,
max_iters = 100_000,
verbose = true,
verbose_timing = verbose,
decompose = false,
2022-11-07 18:45:12 +01:00
)
return JuMP.optimizer_with_attributes(
COSMO.Optimizer,
2023-03-19 20:33:28 +01:00
"accelerator" =>
COSMO.with_options(COSMO.AndersonAccelerator; mem = max(accel, 2)),
2022-11-07 18:45:12 +01:00
"alpha" => alpha,
"decompose" => decompose,
"eps_abs" => eps,
"eps_rel" => eps,
"max_iter" => max_iters,
"verbose" => verbose,
"verbose_timing" => verbose_timing,
2023-03-19 20:33:28 +01:00
"check_termination" => 250,
2022-11-07 18:45:12 +01:00
)
end