Skip to content

Commit 43b8f6a

Browse files
remove nuInv in R2DH & R2N & TRDH
1 parent 8e80540 commit 43b8f6a

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/R2DH.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function R2DH(
191191
Dkσk = D.d .+ σk
192192
DNorm = norm(D.d, Inf)
193193

194-
ν = 1 / ((DNorm + σk) * (1 + θ))
194+
ν = θ / (DNorm + σk)
195195
mν∇fk = -ν * ∇fk
196196
sqrt_ξ_νInv = one(R)
197197

@@ -274,7 +274,7 @@ function R2DH(
274274
end
275275

276276
Dkσk .= D.d .+ σk
277-
ν = 1 / ((DNorm + σk) * (1 + θ))
277+
ν = θ / (DNorm + σk)
278278

279279
tired = maxIter > 0 && k maxIter
280280
if !tired

src/R2N.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function R2N(
134134

135135
λmax, found_λ = opnorm(Bk)
136136
found_λ || error("operator norm computation failed")
137-
νInv = (1 + θ) * (σk + λmax)
137+
ν = θ / (σk + λmax)
138138
sqrt_ξ1_νInv = one(R)
139139

140140
optimal = false
@@ -166,11 +166,11 @@ function R2N(
166166
# take first proximal gradient step s1 and see if current xk is nearly stationary
167167
# s1 minimizes φ1(s) + ‖s‖² / 2 / ν + ψ(s) ⟺ s1 ∈ prox{νψ}(-ν∇φ1(0)).
168168

169-
subsolver_options.ν = 1 / νInv
169+
subsolver_options.ν = ν
170170
prox!(s, ψ, -subsolver_options.ν * ∇fk, subsolver_options.ν)
171171
ξ1 = hk - mk1(s) + max(1, abs(hk)) * 10 * eps()
172172
ξ1 > 0 || error("R2N: first prox-gradient step should produce a decrease but ξ1 = $(ξ1)")
173-
sqrt_ξ1_νInv = sqrt(ξ1 * νInv)
173+
sqrt_ξ1_νInv = sqrt(ξ1 / ν)
174174

175175
if ξ1 0 && k == 1
176176
ϵ_increment = ϵr * sqrt_ξ1_νInv
@@ -188,7 +188,7 @@ function R2N(
188188
subsolver_options.ϵa = k == 1 ? 1.0e-3 : min(sqrt_ξ1_νInv^(1.5), sqrt_ξ1_νInv * 1e-3)
189189
verbose > 0 && @debug "setting inner stopping tolerance to" subsolver_options.optTol
190190
subsolver_options.σk = σk
191-
subsolver_args = subsolver == R2DH ? (SpectralGradient(νInv, f.meta.nvar),) : ()
191+
subsolver_args = subsolver == R2DH ? (SpectralGradient(1 / ν, f.meta.nvar),) : ()
192192
s, iter, _ = with_logger(subsolver_logger) do
193193
subsolver(φ, ∇φ!, ψ, subsolver_args..., subsolver_options, s)
194194
end
@@ -256,7 +256,7 @@ function R2N(
256256
if ρk < η1 || ρk == Inf
257257
σk = σk * γ
258258
end
259-
νInv = (1 + θ) * (σk + λmax)
259+
ν = θ / (σk + λmax)
260260
tired = k maxIter || elapsed_time > maxTime
261261
end
262262

src/TRDH_alg.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ function TRDH(
200200
∇f!(∇fk, xk)
201201
∇fk⁻ = copy(∇fk)
202202
DNorm = norm(D.d, Inf)
203-
νInv = DNorm + one(R) /* Δk)
204-
ν = one(R) / νInv
203+
ν =* Δk)/(DNorm + one(R))
205204
mν∇fk = -ν .* ∇fk
206205
sqrt_ξ_νInv = one(R)
207206

@@ -318,8 +317,7 @@ function TRDH(
318317
has_bnds ? set_bounds!(ψ, l_bound_k, u_bound_k) : set_radius!(ψ, Δk)
319318
end
320319

321-
νInv = reduce_TR ? (DNorm + one(R) /* Δk)) : (DNorm + one(R) / α)
322-
ν = one(R) / νInv
320+
ν = reduce_TR ?* Δk)/(DNorm + one(R)) : α / (DNorm + one(R))
323321
mν∇fk .= -ν .* ∇fk
324322

325323
tired = k maxIter || elapsed_time > maxTime

0 commit comments

Comments
 (0)