From 4bf87cb00f69749145f5290ccd172589ae69d92b Mon Sep 17 00:00:00 2001 From: Maxence Gollier Date: Sun, 23 Feb 2025 18:44:00 -0500 Subject: [PATCH 1/3] add sigma entry in RegExecStats --- src/R2_alg.jl | 2 ++ src/utils.jl | 1 + 2 files changed, 3 insertions(+) diff --git a/src/R2_alg.jl b/src/R2_alg.jl index 89d1918e..0cea37e8 100644 --- a/src/R2_alg.jl +++ b/src/R2_alg.jl @@ -410,6 +410,7 @@ function SolverCore.solve!( set_objective!(stats, fk + hk) set_solver_specific!(stats, :smooth_obj, fk) set_solver_specific!(stats, :nonsmooth_obj, hk) + set_solver_specific!(stats, :sigma, σk) φk(d) = dot(∇fk, d) mk(d)::T = φk(d) + ψ(d)::T @@ -498,6 +499,7 @@ function SolverCore.solve!( set_objective!(stats, fk + hk) set_solver_specific!(stats, :smooth_obj, fk) set_solver_specific!(stats, :nonsmooth_obj, hk) + set_solver_specific!(stats, :sigma, σk) set_iter!(stats, stats.iter + 1) set_time!(stats, time() - start_time) diff --git a/src/utils.jl b/src/utils.jl index f0853b7d..a33dc274 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -37,5 +37,6 @@ function RegularizedExecutionStats(reg_nlp::AbstractRegularizedNLPModel{T, V}) w stats = GenericExecutionStats(reg_nlp.model, solver_specific = Dict{Symbol, T}()) set_solver_specific!(stats, :smooth_obj, T(Inf)) set_solver_specific!(stats, :nonsmooth_obj, T(Inf)) + set_solver_specific!(stats, :sigma, T(Inf)) return stats end From bb0415437f9df14fd82a50d3b746b70be60fcb03 Mon Sep 17 00:00:00 2001 From: Maxence Gollier Date: Mon, 3 Mar 2025 13:29:04 -0500 Subject: [PATCH 2/3] add radius in solver_specifics --- src/utils.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.jl b/src/utils.jl index a33dc274..422f8744 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -38,5 +38,6 @@ function RegularizedExecutionStats(reg_nlp::AbstractRegularizedNLPModel{T, V}) w set_solver_specific!(stats, :smooth_obj, T(Inf)) set_solver_specific!(stats, :nonsmooth_obj, T(Inf)) set_solver_specific!(stats, :sigma, T(Inf)) + set_solver_specific!(stats, :radius, T(Inf)) return stats end From 6727f9cc2a435b2e26aebdf38613e2483342a0ed Mon Sep 17 00:00:00 2001 From: Maxence Gollier Date: Wed, 26 Mar 2025 15:55:09 -0400 Subject: [PATCH 3/3] add :sigma and :radius solver specific entries to LM,LMTR,R2DH,R2N,TR,TRDH --- src/LMTR_alg.jl | 1 + src/LM_alg.jl | 1 + src/R2DH.jl | 2 ++ src/R2N.jl | 1 + src/TRDH_alg.jl | 2 ++ src/TR_alg.jl | 1 + 6 files changed, 8 insertions(+) diff --git a/src/LMTR_alg.jl b/src/LMTR_alg.jl index c4cfa838..e56be3b1 100644 --- a/src/LMTR_alg.jl +++ b/src/LMTR_alg.jl @@ -294,6 +294,7 @@ function LMTR( set_residuals!(stats, zero(eltype(xk)), ξ1 ≥ 0 ? sqrt(ξ1) : ξ1) set_iter!(stats, k) set_time!(stats, elapsed_time) + set_solver_specific!(stats, :radius, Δk) set_solver_specific!(stats, :Fhist, Fobj_hist[1:k]) set_solver_specific!(stats, :Hhist, Hobj_hist[1:k]) set_solver_specific!(stats, :NonSmooth, h) diff --git a/src/LM_alg.jl b/src/LM_alg.jl index 56bc5356..c55bff30 100644 --- a/src/LM_alg.jl +++ b/src/LM_alg.jl @@ -282,6 +282,7 @@ function LM( set_residuals!(stats, zero(eltype(xk)), ξ1 ≥ 0 ? sqrt(ξ1) : ξ1) set_iter!(stats, k) set_time!(stats, elapsed_time) + set_solver_specific!(stats, :sigma, σk) set_solver_specific!(stats, :Fhist, Fobj_hist[1:k]) set_solver_specific!(stats, :Hhist, Hobj_hist[1:k]) set_solver_specific!(stats, :NonSmooth, h) diff --git a/src/R2DH.jl b/src/R2DH.jl index 7f01912d..d87da427 100644 --- a/src/R2DH.jl +++ b/src/R2DH.jl @@ -61,6 +61,7 @@ function R2DH( set_residuals!(stats, zero(eltype(xk)), sqrt_ξ_νInv) set_iter!(stats, k) set_time!(stats, outdict[:elapsed_time]) + set_solver_specific!(stats, :sigma, outdict[:sigma]) set_solver_specific!(stats, :Fhist, outdict[:Fhist]) set_solver_specific!(stats, :Hhist, outdict[:Hhist]) set_solver_specific!(stats, :Time_hist, outdict[:Time_hist]) @@ -313,6 +314,7 @@ function R2DH( :hk => hk, :sqrt_ξ_νInv => sqrt_ξ_νInv, :elapsed_time => elapsed_time, + :sigma => σk ) return xk, k, outdict diff --git a/src/R2N.jl b/src/R2N.jl index ba27f963..ff661ab3 100644 --- a/src/R2N.jl +++ b/src/R2N.jl @@ -286,6 +286,7 @@ function R2N( set_residuals!(stats, zero(eltype(xk)), sqrt_ξ1_νInv) set_iter!(stats, k) set_time!(stats, elapsed_time) + set_solver_specific!(stats, :sigma, σk) set_solver_specific!(stats, :Fhist, Fobj_hist[1:k]) set_solver_specific!(stats, :Hhist, Hobj_hist[1:k]) set_solver_specific!(stats, :NonSmooth, h) diff --git a/src/TRDH_alg.jl b/src/TRDH_alg.jl index 57e83155..77a447f2 100644 --- a/src/TRDH_alg.jl +++ b/src/TRDH_alg.jl @@ -75,6 +75,7 @@ function TRDH( set_residuals!(stats, zero(eltype(xk)), sqrt_ξ_νInv) set_iter!(stats, k) set_time!(stats, outdict[:elapsed_time]) + set_solver_specific!(stats, :radius, outdict[:radius]) set_solver_specific!(stats, :Fhist, outdict[:Fhist]) set_solver_specific!(stats, :Hhist, outdict[:Hhist]) set_solver_specific!(stats, :NonSmooth, outdict[:NonSmooth]) @@ -364,6 +365,7 @@ function TRDH( :hk => hk, :sqrt_ξ_νInv => sqrt_ξ_νInv, :elapsed_time => elapsed_time, + :radius => Δk, ) return xk, k, outdict diff --git a/src/TR_alg.jl b/src/TR_alg.jl index 700b22c1..8ad2f26a 100644 --- a/src/TR_alg.jl +++ b/src/TR_alg.jl @@ -283,6 +283,7 @@ function TR( set_residuals!(stats, zero(eltype(xk)), sqrt_ξ1_νInv) set_iter!(stats, k) set_time!(stats, elapsed_time) + set_solver_specific!(stats, :radius, Δk) set_solver_specific!(stats, :Fhist, Fobj_hist[1:k]) set_solver_specific!(stats, :Hhist, Hobj_hist[1:k]) set_solver_specific!(stats, :NonSmooth, h)