Skip to content

Commit 751570f

Browse files
implement LMTR regularizedNLP signatures
1 parent de31909 commit 751570f

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

src/LMTR_alg.jl

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,20 @@ For advanced usage, first define a solver "LMSolver" to preallocate the memory u
134134
# Keyword arguments
135135
- `x::V = nlp.meta.x0`: the initial guess;
136136
- `atol::T = √eps(T)`: absolute tolerance;
137+
- `sub_atol::T = atol`: subsolver absolute tolerance;
137138
- `rtol::T = √eps(T)`: relative tolerance;
138139
- `neg_tol::T = zero(T): negative tolerance;
139140
- `max_eval::Int = -1`: maximum number of evaluation of the objective function (negative number means unlimited);
140141
- `max_time::Float64 = 30.0`: maximum time limit in seconds;
141142
- `max_iter::Int = 10000`: maximum number of iterations;
142143
- `verbose::Int = 0`: if > 0, display iteration details every `verbose` iteration;
143-
- `Δk::T = eps(T)`: minimum value of the regularization parameter;
144+
- `Δk::T = eps(T)`: initial value of the trust-region radius;
144145
- `η1::T = √√eps(T)`: successful iteration threshold;
145146
- `η2::T = T(0.9)`: very successful iteration threshold;
146-
- `γ::T = T(3)`: regularization parameter multiplier, σ := σ/γ when the iteration is very successful and σ := σγ when the iteration is unsuccessful;
147+
- `γ::T = T(3)`: trust-region radius parameter multiplier, Δ := Δ*γ when the iteration is very successful and Δ := Δ/γ when the iteration is unsuccessful;
147148
- `α::T = 1/eps(T)`: TODO
148149
- `β::T = 1/eps(T)`: TODO
149-
- `χ::F = NormLinf(1)`: norm used to define the trust-region;`
150+
- `χ = NormLinf(1)`: norm used to define the trust-region;`
150151
- `subsolver::S = R2Solver`: subsolver used to solve the subproblem that appears at each iteration.
151152
152153
The algorithm stops either when `√(ξₖ/νₖ) < atol + rtol*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure.
@@ -178,14 +179,35 @@ function LMTR(
178179
options::ROSolverOptions;
179180
kwargs...
180181
) where {H, X}
181-
182+
kwargs_dict = Dict(kwargs...)
183+
selected = pop!(kwargs_dict, :selected, 1:(nls.meta.nvar))
184+
reg_nls = RegularizedNLPModel(nls, h, selected)
185+
return LMTR(
186+
reg_nls;
187+
χ = χ,
188+
atol = options.ϵa,
189+
rtol = options.ϵr,
190+
neg_tol = options.neg_tol,
191+
verbose = options.verbose,
192+
max_iter = options.maxIter,
193+
max_time = options.maxTime,
194+
Δk = options.Δk,
195+
η1 = options.η1,
196+
η2 = options.η2,
197+
γ = options.γ,
198+
α = options.α,
199+
β = options.β,
200+
kwargs_dict...,
201+
)
182202
end
183203

184-
function LMTR(
185-
reg_nls::AbstractRegularizedNLPModel;
186-
kwargs...
187-
)
188-
204+
function LMTR(reg_nls::AbstractRegularizedNLPModel{T}; kwargs...) where{T}
205+
kwargs_dict = Dict(kwargs...)
206+
subsolver = pop!(kwargs_dict, :subsolver, R2Solver)
207+
χ = pop!(kwargs_dict, , NormLinf(one(T)))
208+
solver = LMTRSolver(reg_nls, χ = χ, subsolver = subsolver)
209+
stats = RegularizedExecutionStats(reg_nls)
210+
solve!(solver, reg_nls, stats; kwargs_dict...)
189211
end
190212

191213
function SolverCore.solve!(

0 commit comments

Comments
 (0)