1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-25 18:25:30 +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(;
accel=10,
alpha=1.5,
eps=1e-9,
max_iters=100_000,
verbose=true,
linear_solver=SCS.DirectSolver
)
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(;
accel=15,
alpha=1.6,
eps=1e-9,
max_iters=100_000,
verbose=true,
verbose_timing=verbose,
decompose=false
)
return JuMP.optimizer_with_attributes(
COSMO.Optimizer,
"accelerator" => COSMO.with_options(
COSMO.AndersonAccelerator,
mem=max(accel, 2)
),
"alpha" => alpha,
"decompose" => decompose,
"eps_abs" => eps,
"eps_rel" => eps,
"max_iter" => max_iters,
"verbose" => verbose,
"verbose_timing" => verbose_timing,
"check_termination" => 200,
)
end