Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TR: fix definition of ν #124

Merged
merged 7 commits into from
Feb 20, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/TR_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ function TR(
Bk = hess_op(f, xk)

λmax = opnorm(Bk)
νInv = (1 + θ) * λmax
ν = 1 / (νInv + 1 / (Δk * α))
αΔ = α * Δk
dpo marked this conversation as resolved.
Show resolved Hide resolved
ν = αΔ / (1 + λmax * (1 + αΔ))
dpo marked this conversation as resolved.
Show resolved Hide resolved
sqrt_ξ1_νInv = one(R)

optimal = false
Expand Down Expand Up @@ -216,7 +216,7 @@ function TR(

if (verbose > 0) && (k % ptf == 0)
#! format: off
@info @sprintf "%6d %8d %8.1e %8.1e %7.1e %7.1e %8.1e %7.1e %7.1e %7.1e %7.1e %1s" k iter fk hk sqrt_ξ1_νInv sqrt(ξ) ρk ∆_effective χ(xk) sNorm νInv TR_stat
@info @sprintf "%6d %8d %8.1e %8.1e %7.1e %7.1e %8.1e %7.1e %7.1e %7.1e %7.1e %1s" k iter fk hk sqrt_ξ1_νInv sqrt(ξ) ρk ∆_effective χ(xk) sNorm λmax TR_stat
#! format: on
end

Expand All @@ -241,7 +241,6 @@ function TR(
end
Bk = hess_op(f, xk)
λmax = opnorm(Bk)
νInv = (1 + θ) * λmax
∇fk⁻ .= ∇fk
end

Expand All @@ -250,7 +249,8 @@ function TR(
(has_bounds(f) || subsolver == TRDH) ?
set_bounds!(ψ, max.(-Δk, l_bound - xk), min.(Δk, u_bound - xk)) : set_radius!(ψ, Δk)
end
ν = 1 / (νInv + 1 / (Δk * α))
αΔ = α * Δk
dpo marked this conversation as resolved.
Show resolved Hide resolved
ν = αΔ / (1 + λmax * (1 + αΔ))
dpo marked this conversation as resolved.
Show resolved Hide resolved
tired = k ≥ maxIter || elapsed_time > maxTime
end

Expand All @@ -259,7 +259,7 @@ function TR(
@info @sprintf "%6d %8s %8.1e %8.1e" k "" fk hk
elseif optimal
#! 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_νInv sqrt(ξ1) "" Δk χ(xk) χ(s) νInv
@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_νInv sqrt(ξ1) "" Δk χ(xk) χ(s) λmax
#! format: on
@info "TR: terminating with √(ξ1/ν) = $(sqrt_ξ1_νInv)"
end
Expand Down