Skip to content

Commit

Permalink
🤖 Format .jl files (#94)
Browse files Browse the repository at this point in the history
Co-authored-by: geoffroyleconte <[email protected]>
  • Loading branch information
github-actions[bot] and geoffroyleconte authored Mar 24, 2023
1 parent 2ea2780 commit 3ddb3ef
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 45 deletions.
35 changes: 29 additions & 6 deletions benchmarks/tables/bpdn-constr-table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,34 @@ maxIter = 500
maxIter_inner = 100
options =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true)
options_nrTR =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true, reduce_TR = false)
options_nrTR = ROSolverOptions(
ν = ν,
ϵa = ϵ,
ϵr = ϵ,
verbose = verbose,
maxIter = maxIter,
spectral = true,
reduce_TR = false,
)
options2 = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options2_nrTR = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options3 = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options2_nrTR = ROSolverOptions(
spectral = false,
psb = true,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options3 =
ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(
spectral = false,
psb = false,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options4 = ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options4_nrTR =
ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
Expand Down Expand Up @@ -67,7 +89,8 @@ options6_nrTR = ROSolverOptions(
)

solvers = [:R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TR, :TR, :TR, :TR, :TR, :TR, :TR]
subsolvers = [:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
subsolvers =
[:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
solver_options = [
options,
options,
Expand Down
35 changes: 29 additions & 6 deletions benchmarks/tables/bpdn-table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,34 @@ maxIter = 500
maxIter_inner = 100
options =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true)
options_nrTR =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true, reduce_TR = false)
options_nrTR = ROSolverOptions(
ν = ν,
ϵa = ϵ,
ϵr = ϵ,
verbose = verbose,
maxIter = maxIter,
spectral = true,
reduce_TR = false,
)
options2 = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options2_nrTR = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options3 = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options2_nrTR = ROSolverOptions(
spectral = false,
psb = true,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options3 =
ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(
spectral = false,
psb = false,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options4 = ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options4_nrTR =
ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
Expand Down Expand Up @@ -68,7 +90,8 @@ options6_nrTR = ROSolverOptions(
)

solvers = [:R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TR, :TR, :TR, :TR, :TR, :TR, :TR]
subsolvers = [:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
subsolvers =
[:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
solver_options = [
options,
options,
Expand Down
39 changes: 31 additions & 8 deletions benchmarks/tables/fh-table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,34 @@ maxIter_inner = 200 # max iter for subsolver
ϵri = 1.0e-6
options =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true)
options_nrTR =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true, reduce_TR = false)
options_nrTR = ROSolverOptions(
ν = ν,
ϵa = ϵ,
ϵr = ϵ,
verbose = verbose,
maxIter = maxIter,
spectral = true,
reduce_TR = false,
)
options2 = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options2_nrTR = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options3 = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options2_nrTR = ROSolverOptions(
spectral = false,
psb = true,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options3 =
ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(
spectral = false,
psb = false,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options4 = ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options4_nrTR =
ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
Expand Down Expand Up @@ -68,7 +90,8 @@ options6_nrTR = ROSolverOptions(
)

solvers = [:R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TR, :TR, :TR, :TR, :TR, :TR, :TR]
subsolvers = [:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
subsolvers =
[:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
solver_options = [
options,
options,
Expand Down Expand Up @@ -121,8 +144,8 @@ names, stats = benchmark_table(
if display_sol
data = zeros(length(subset) + 1, 5)
data[1, :] .= x0
for i=1:length(subset)
data[i+1, :] .= stats[i].solution
for i = 1:length(subset)
data[i + 1, :] .= stats[i].solution
end
pretty_table(
data;
Expand Down
35 changes: 29 additions & 6 deletions benchmarks/tables/nnmf-table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,34 @@ maxIter_inner = 100
verbose = 0 #10
options =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true)
options_nrTR =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true, reduce_TR = false)
options_nrTR = ROSolverOptions(
ν = ν,
ϵa = ϵ,
ϵr = ϵ,
verbose = verbose,
maxIter = maxIter,
spectral = true,
reduce_TR = false,
)
options2 = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options2_nrTR = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options3 = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options2_nrTR = ROSolverOptions(
spectral = false,
psb = true,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options3 =
ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(
spectral = false,
psb = false,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options4 = ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options4_nrTR =
ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
Expand Down Expand Up @@ -64,7 +86,8 @@ options6_nrTR = ROSolverOptions(
)

solvers = [:R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TR, :TR, :TR, :TR, :TR, :TR, :TR]
subsolvers = [:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
subsolvers =
[:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
solver_options = [
options,
options,
Expand Down
21 changes: 8 additions & 13 deletions benchmarks/tables/regulopt-tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ function options_str(
out_str = !options.spectral ? (options.psb ? "-PSB" : "-Andrei") : "-Spec"
out_str = (options.reduce_TR) ? out_str : string(out_str, "-noredTR")
elseif solver == :TR && subsolver == :TRDH
out_str =
!subsolver_options.spectral ? (subsolver_options.psb ? "-PSB" : "-Andrei") :
"-Spec"
out_str = !subsolver_options.spectral ? (subsolver_options.psb ? "-PSB" : "-Andrei") : "-Spec"
out_str = (subsolver_options.reduce_TR) ? out_str : string(out_str, "-noredTR")
else
out_str = ""
Expand Down Expand Up @@ -112,7 +110,7 @@ function benchmark_table(
L"$\# \ \nabla f$",
L"$\# \ prox$",
L"$t$ ($s$)",
]
]
else
header = [
"solver",
Expand Down Expand Up @@ -162,7 +160,7 @@ function benchmark_table(
data[i, :] .= [sname, fx, hx / λ, ξ, nf, n∇f, nprox, t]
else
if pb_name[1:3] == "SVM"
string(round(t,digits=2))
string(round(t, digits = 2))
err = "($(
round(acc(residual(nls_train, solver_out.solution)), digits=1)), $(
round(acc(residual(nls_test, solver_out.solution)), digits = 1)))"
Expand All @@ -178,9 +176,11 @@ function benchmark_table(
print_formats = ft_printf(["%s", "%7.2e", h_format, "%7.1e", "%i", "%i", "%i", "%7.1e"], 1:nh)
else
if pb_name[1:3] == "SVM"
print_formats = ft_printf(["%s", "%7.2e", h_format, "%7.1e", "%7s", "%i", "%i", "%i", "%7.1e"], 1:nh)
print_formats =
ft_printf(["%s", "%7.2e", h_format, "%7.1e", "%7s", "%i", "%i", "%i", "%7.1e"], 1:nh)
else
print_formats = ft_printf(["%s", "%7.2e", h_format, "%7.1e", "%7.1e", "%i", "%i", "%i", "%7.1e"], 1:nh)
print_formats =
ft_printf(["%s", "%7.2e", h_format, "%7.1e", "%7.1e", "%i", "%i", "%i", "%7.1e"], 1:nh)
end
end

Expand All @@ -200,12 +200,7 @@ function benchmark_table(
),
)
else
pretty_table(
data;
header = header,
title = title,
formatters = (print_formats,),
)
pretty_table(data; header = header, title = title, formatters = (print_formats,))
end
return solver_names, solver_stats
end
Expand Down
35 changes: 29 additions & 6 deletions benchmarks/tables/svm-table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,34 @@ maxIter = 500
maxIter_inner = 100
options =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true)
options_nrTR =
ROSolverOptions= ν, ϵa = ϵ, ϵr = ϵ, verbose = verbose, maxIter = maxIter, spectral = true, reduce_TR = false)
options_nrTR = ROSolverOptions(
ν = ν,
ϵa = ϵ,
ϵr = ϵ,
verbose = verbose,
maxIter = maxIter,
spectral = true,
reduce_TR = false,
)
options2 = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options2_nrTR = ROSolverOptions(spectral = false, psb = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options3 = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
options2_nrTR = ROSolverOptions(
spectral = false,
psb = true,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options3 =
ROSolverOptions(spectral = false, psb = false, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options3_nrTR = ROSolverOptions(
spectral = false,
psb = false,
ϵa = ϵi,
ϵr = ϵri,
maxIter = maxIter_inner,
reduce_TR = false,
)
options4 = ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner)
options4_nrTR =
ROSolverOptions(spectral = true, ϵa = ϵi, ϵr = ϵri, maxIter = maxIter_inner, reduce_TR = false)
Expand Down Expand Up @@ -67,7 +89,8 @@ options6_nrTR = ROSolverOptions(
)

solvers = [:R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TR, :TR, :TR, :TR, :TR, :TR, :TR]
subsolvers = [:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
subsolvers =
[:None, :None, :None, :None, :None, :None, :None, :R2, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH, :TRDH]
solver_options = [
options,
options,
Expand Down

0 comments on commit 3ddb3ef

Please sign in to comment.