From d1d2b7846c0e151014693c656fc5a438f10afea2 Mon Sep 17 00:00:00 2001 From: Maxence Gollier Date: Tue, 23 Sep 2025 18:28:53 -0400 Subject: [PATCH 1/2] solve for LMTR optimality measure --- src/LMTR_alg.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LMTR_alg.jl b/src/LMTR_alg.jl index 621bedb4..1459e82c 100644 --- a/src/LMTR_alg.jl +++ b/src/LMTR_alg.jl @@ -134,6 +134,7 @@ function LMTR( found_σ || error("operator norm computation failed") α⁻¹Δ⁻¹ = 1 / (α * Δk) ν = 1 / (α⁻¹Δ⁻¹ + σmax^2 * (α⁻¹Δ⁻¹ + 1)) # ‖J'J‖ = ‖J‖² + sqrt_ξ1_νInv = one(eltype(xk)) mν∇fk = -∇fk * ν @@ -178,14 +179,15 @@ function LMTR( prox!(s, ψ, mν∇fk, ν) ξ1 = fk + hk - mk1(s) + max(1, abs(fk + hk)) * 10 * eps() ξ1 > 0 || error("LMTR: first prox-gradient step should produce a decrease but ξ1 = $(ξ1)") + sqrt_ξ1_νInv = ξ1 ≥ 0 ? sqrt(ξ1 / ν) : sqrt(-ξ1 / ν) if ξ1 ≥ 0 && k == 1 - ϵ_increment = ϵr * sqrt(ξ1) + ϵ_increment = ϵr * sqrt_ξ1_νInv ϵ += ϵ_increment # make stopping test absolute and relative ϵ_subsolver += ϵ_increment end - if sqrt(ξ1) < ϵ + if sqrt_ξ1_νInv < ϵ # the current xk is approximately first-order stationary optimal = true continue From 174d273da61581940f8c357ca1469dfe0ee84659 Mon Sep 17 00:00:00 2001 From: Maxence Gollier Date: Tue, 23 Sep 2025 21:40:44 -0400 Subject: [PATCH 2/2] print out optimality measure correctly --- src/LMTR_alg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LMTR_alg.jl b/src/LMTR_alg.jl index 1459e82c..4b958522 100644 --- a/src/LMTR_alg.jl +++ b/src/LMTR_alg.jl @@ -278,7 +278,7 @@ function LMTR( #! format: off @info @sprintf "%6d %8d %8.1e %8.1e %7.1e %7.1e %8s %7.1e %7.1e %7.1e %7.1e" k 1 fk hk sqrt(ξ1) sqrt(ξ1) "" Δk χ(xk) χ(s) ν #! format: on - @info "LMTR: terminating with √ξ1 = $(sqrt(ξ1))" + @info "LMTR: terminating with √(ξ1/ν) = $(sqrt_ξ1_νInv)" end end