diff --git a/benchmarks/tables/bpdn-constr-table.jl b/benchmarks/tables/bpdn-constr-table.jl index d081b0e0..8661cdde 100644 --- a/benchmarks/tables/bpdn-constr-table.jl +++ b/benchmarks/tables/bpdn-constr-table.jl @@ -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) @@ -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, diff --git a/benchmarks/tables/bpdn-table.jl b/benchmarks/tables/bpdn-table.jl index f3d918e1..013c091c 100644 --- a/benchmarks/tables/bpdn-table.jl +++ b/benchmarks/tables/bpdn-table.jl @@ -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) @@ -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, diff --git a/benchmarks/tables/fh-table.jl b/benchmarks/tables/fh-table.jl index 25adccfa..bef74068 100644 --- a/benchmarks/tables/fh-table.jl +++ b/benchmarks/tables/fh-table.jl @@ -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) @@ -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, @@ -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; diff --git a/benchmarks/tables/nnmf-table.jl b/benchmarks/tables/nnmf-table.jl index d9bd4ca1..f91d88d6 100644 --- a/benchmarks/tables/nnmf-table.jl +++ b/benchmarks/tables/nnmf-table.jl @@ -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) @@ -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, diff --git a/benchmarks/tables/regulopt-tables.jl b/benchmarks/tables/regulopt-tables.jl index 8233e327..21eda78f 100644 --- a/benchmarks/tables/regulopt-tables.jl +++ b/benchmarks/tables/regulopt-tables.jl @@ -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 = "" @@ -112,7 +110,7 @@ function benchmark_table( L"$\# \ \nabla f$", L"$\# \ prox$", L"$t$ ($s$)", - ] + ] else header = [ "solver", @@ -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)))" @@ -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 @@ -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 diff --git a/benchmarks/tables/svm-table.jl b/benchmarks/tables/svm-table.jl index 78daa8e7..a190206a 100644 --- a/benchmarks/tables/svm-table.jl +++ b/benchmarks/tables/svm-table.jl @@ -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) @@ -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,