Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manifest.toml
6 changes: 3 additions & 3 deletions src/LM_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function LMSolver(
shifted(reg_nls.h, xk)

Jk = jac_op_residual(reg_nls.model, xk)
sub_nlp = LMModel(Jk, Fk, T(1), xk)
sub_nlp = LMModel(Jk, Fk, T(0), xk)
subpb = RegularizedNLPModel(sub_nlp, ψ)
substats = RegularizedExecutionStats(subpb)
subsolver = subsolver(subpb)
Expand Down Expand Up @@ -300,7 +300,7 @@ function SolverCore.solve!(
end

mk = let ψ = ψ, solver = solver
d -> obj(solver.subpb.model, d) + ψ(d)
d -> obj(solver.subpb.model, d) - solver.subpb.model.σ * dot(d, d) / 2 + ψ(d)
end

prox!(s, ψ, mν∇fk, ν)
Expand Down Expand Up @@ -331,7 +331,7 @@ function SolverCore.solve!(

while !done
sub_atol = stats.iter == 0 ? 1.0e-3 : min(sqrt_ξ1_νInv ^ (1.5), sqrt_ξ1_νInv * 1e-3)
solver.subpb.model.σ = σk

isa(solver.subsolver, R2DHSolver) && (solver.subsolver.D.d[1] = 1/ν)
if isa(solver.subsolver, R2Solver) #FIXME
solve!(solver.subsolver, solver.subpb, solver.substats, x = s, atol = sub_atol, ν = ν)
Expand Down
5 changes: 2 additions & 3 deletions src/R2N.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function R2NSolver(
shifted(reg_nlp.h, xk)

Bk = hess_op(reg_nlp.model, x0)
sub_nlp = R2NModel(Bk, ∇fk, T(1), x0)
sub_nlp = R2NModel(Bk, ∇fk, T(0), x0)
subpb = RegularizedNLPModel(sub_nlp, ψ)
substats = RegularizedExecutionStats(subpb)
subsolver = subsolver(subpb)
Expand Down Expand Up @@ -327,7 +327,7 @@ function SolverCore.solve!(
end

mk = let ψ = ψ, solver = solver
d -> obj(solver.subpb.model, d) + ψ(d)::T
d -> obj(solver.subpb.model, d) - solver.subpb.model.σ * dot(d, d) / 2 + ψ(d)::T
end

prox!(s1, ψ, mν∇fk, ν₁)
Expand Down Expand Up @@ -361,7 +361,6 @@ function SolverCore.solve!(
while !done
sub_atol = stats.iter == 0 ? 1.0e-3 : min(sqrt_ξ1_νInv ^ (1.5), sqrt_ξ1_νInv * 1e-3)

solver.subpb.model.σ = σk
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpo is this ok for you?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we remove this ?
solver.subpb.model.σwill not be updated anywhere ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that line needs to stay. It's the computation of $\xi_k$ that is inefficient. Please grab the model value from the stats and subtract the $\tfrac{1}{2} \sigma |s|^2$ to avoid recomputing it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should close this as this issue has been treated here PR by Maxence.

isa(solver.subsolver, R2DHSolver) && (solver.subsolver.D.d[1] = 1/ν₁)
if isa(solver.subsolver, R2Solver) #FIXME
solve!(
Expand Down
Loading