1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-13 14:00:27 +01:00
PropertyT.jl/test/optimizers.jl

55 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,
2023-04-06 11:40:49 +02:00
"eps_prim_inf" => eps,
"eps_dual_inf" => eps,
2022-11-07 18:45:12 +01:00
"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