Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Percival = "0.7.2"
ProximalOperators = "0.15"
RegularizedProblems = "0.1.3"
ShiftedProximalOperators = "0.2"
SolverCore = "0.3.0"
SolverCore = "0.3.10"
julia = "^1.6.0"

[extras]
Expand Down
2 changes: 2 additions & 0 deletions src/LMTR_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ function SolverCore.solve!(

σmax, found_σ = opnorm(solver.subpb.model.J)
found_σ || error("operator norm computation failed")
set_step_status!(stats, :accepted)
end

if η2 ≤ ρk < Inf
Expand All @@ -438,6 +439,7 @@ function SolverCore.solve!(
set_radius!(solver.subsolver.ψ, Δk)
set_radius!(ψ, Δk)
end
set_step_status!(stats, :rejected)
end

set_objective!(stats, fk + hk)
Expand Down
2 changes: 2 additions & 0 deletions src/LM_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ function SolverCore.solve!(
σmax, found_σ = opnorm(solver.subpb.model.J)
found_σ || error("operator norm computation failed")
end
set_step_status!(stats, :accepted)
end

if η2 ≤ ρk < Inf
Expand All @@ -424,6 +425,7 @@ function SolverCore.solve!(

if ρk < η1 || ρk == Inf
σk = σk * γ
set_step_status!(stats, :rejected)
end

m_monotone > 1 && (m_fh_hist[stats.iter % (m_monotone - 1) + 1] = fk + hk)
Expand Down
2 changes: 2 additions & 0 deletions src/R2DH.jl
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ function SolverCore.solve!(
@. ∇fk⁻ = ∇fk - ∇fk⁻
push!(D, s, ∇fk⁻) # update QN operator
∇fk⁻ .= ∇fk
set_step_status!(stats, :accepted)
end

if η2 ≤ ρk < Inf
Expand All @@ -410,6 +411,7 @@ function SolverCore.solve!(

if ρk < η1 || ρk == Inf
σk = σk * γ
set_step_status!(stats, :rejected)
end

set_objective!(stats, fk + hk)
Expand Down
2 changes: 2 additions & 0 deletions src/R2N.jl
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ function SolverCore.solve!(
λmax = power_method!(solver.subpb.model.B, solver.v0, solver.subpb.model.v, opnorm_maxiter)
end
found_λ || error("operator norm computation failed")
set_step_status!(stats, :accepted)
end

if η2 ≤ ρk < Inf
Expand All @@ -463,6 +464,7 @@ function SolverCore.solve!(

if ρk < η1 || ρk == Inf
σk = σk * γ
set_step_status!(stats, :rejected)
end

ν₁ = θ / (λmax + σk)
Expand Down
2 changes: 2 additions & 0 deletions src/R2_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,15 @@ function SolverCore.solve!(
hk = hkn
grad!(nlp, xk, ∇fk)
shift!(ψ, xk)
set_step_status!(stats, :accepted)
end

if η2 ≤ ρk < Inf
σk = max(σk / γ, σmin)
end
if ρk < η1 || ρk == Inf
σk = σk * γ
set_step_status!(stats, :rejected)
end

ν = 1 / σk
Expand Down
2 changes: 2 additions & 0 deletions src/TRDH_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ function SolverCore.solve!(
dk .= D.d
DNorm = norm(D.d, Inf)
∇fk⁻ .= ∇fk
set_step_status!(stats, :accepted)
end

if η2 ≤ ρk < Inf
Expand All @@ -468,6 +469,7 @@ function SolverCore.solve!(
else
set_radius!(ψ, Δk)
end
set_step_status!(stats, :rejected)
end

set_objective!(stats, fk + hk)
Expand Down
2 changes: 2 additions & 0 deletions src/TR_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ function SolverCore.solve!(
found_λ || error("operator norm computation failed")

∇fk⁻ .= ∇fk
set_step_status!(stats, :accepted)
end

if ρk < η1 || ρk == Inf
Expand All @@ -479,6 +480,7 @@ function SolverCore.solve!(
set_radius!(ψ, Δk)
set_radius!(solver.subsolver.ψ, Δk)
end
set_step_status!(stats, :rejected)
end

m_monotone > 1 && (m_fh_hist[stats.iter % (m_monotone - 1) + 1] = fk + hk)
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ for (mod, mod_name) ∈ ((x -> x, "exact"), (LSR1Model, "lsr1"), (LBFGSModel, "l
@test length(out.solution) == bpdn.meta.nvar
@test typeof(out.dual_feas) == eltype(out.solution)
@test out.status == :first_order
@test out.step_status == (out.iter > 0 ? :accepted : :unknown)
end
end
end
Expand All @@ -55,6 +56,7 @@ for (mod, mod_name) ∈ ((SpectralGradientModel, "spg"),)
@test length(out.solution) == bpdn.meta.nvar
@test typeof(out.dual_feas) == eltype(out.solution)
@test out.status == :first_order
@test out.step_status == (out.iter > 0 ? :accepted : :unknown)
end
end
end
Expand All @@ -71,6 +73,7 @@ for (mod, mod_name) ∈ ((LSR1Model, "lsr1"), (LBFGSModel, "lbfgs"))
@test length(TR_out.solution) == bpdn.meta.nvar
@test typeof(TR_out.dual_feas) == eltype(TR_out.solution)
@test TR_out.status == :first_order
@test TR_out.step_status == (TR_out.iter > 0 ? :accepted : :unknown)
end
end
end
Expand All @@ -90,6 +93,7 @@ for (h, h_name) ∈ ((NormL0(λ), "l0"), (NormL1(λ), "l1"), (IndBallL0(10 * com
@test length(out.solution) == bpdn.meta.nvar
@test typeof(out.dual_feas) == eltype(out.solution)
@test out.status == :first_order
@test out.step_status == (out.iter > 0 ? :accepted : :unknown)
end
end
end
Expand All @@ -105,6 +109,7 @@ for (h, h_name) ∈ ((NormL1(λ), "l1"),)
@test length(LMTR_out.solution) == bpdn.meta.nvar
@test typeof(LMTR_out.dual_feas) == eltype(LMTR_out.solution)
@test LMTR_out.status == :first_order
@test LMTR_out.step_status == (LMTR_out.iter > 0 ? :accepted : :unknown)
end
end

Expand All @@ -129,6 +134,7 @@ for (mod, mod_name) ∈ (
@test length(out.solution) == bpdn.meta.nvar
@test typeof(out.dual_feas) == eltype(out.solution)
@test out.status == :first_order
@test out.step_status == (out.iter > 0 ? :accepted : :unknown)
end
end
end
Expand Down
Loading