Skip to content

Conversation

geoffroyleconte
Copy link
Member

@geoffroyleconte geoffroyleconte commented Jan 24, 2023

Add DiagonalQNModel and SpectralGradientModel based upon the operators in LinearOperators.

I dropped NLPModels 0.18 because there were failures when testing the package with the counters and the show functions (AmplNLReader tests fail because of this).

@codecov
Copy link

codecov bot commented Jan 24, 2023

Codecov Report

Base: 92.31% // Head: 92.40% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (9508cd8) compared to base (157da2e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
+ Coverage   92.31%   92.40%   +0.08%     
==========================================
  Files           6        6              
  Lines         859      869      +10     
==========================================
+ Hits          793      803      +10     
  Misses         66       66              
Impacted Files Coverage Δ
src/quasi-newton.jl 95.55% <100.00%> (+1.26%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

Package name latest stable
ADNLPModels.jl
AmplNLReader.jl
CUTEst.jl
CaNNOLeS.jl
DCI.jl
FletcherPenaltySolver.jl
JSOSolvers.jl
LLSModels.jl
NLPModelsIpopt.jl
NLPModelsJuMP.jl
NLPModelsTest.jl
Percival.jl
QuadraticModels.jl
SolverBenchmark.jl
SolverTools.jl

Copy link
Member

@tmigot tmigot left a comment

Choose a reason for hiding this comment

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

That looks great, thanks @geoffroyleconte for the new feature. I just made a couple of comments to try solve the issues raised, and improve doc and tests.

@geoffroyleconte
Copy link
Member Author

julia> @code_warntype hess_op(nlp, x)
MethodInstance for NLPModels.hess_op(::DiagonalQNModel{Float64, Vector{Float64}, SimpleNLPModel{Float64, Vector{Float64}, NLPModelMeta{Float64, Vector{Float64}}}, NLPModelMeta{Float64, Vector{Float64}}}, ::Vector{Float64})
  from hess_op(nlp::QuasiNewtonModel, x::AbstractVector; kwargs...) in NLPModelsModifiers at C:\Users\Geoffroy Leconte\.julia\dev\NLPModelsModifiers\src\quasi-newton.jl:155
Arguments
  #self#::Core.Const(NLPModels.hess_op)
  nlp::DiagonalQNModel{Float64, Vector{Float64}, SimpleNLPModel{Float64, Vector{Float64}, NLPModelMeta{Float64, Vector{Float64}}}, NLPModelMeta{Float64, Vector{Float64}}}
  x::Vector{Float64}
Body::LinearOperators.DiagonalQN
1%1 = Core.NamedTuple()::Core.Const(NamedTuple())
│   %2 = Base.pairs(%1)::Core.Const(Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}())
│   %3 = NLPModelsModifiers.:(var"#hess_op#20")(%2, #self#, nlp, x)::LinearOperators.DiagonalQN
└──      return %3

(Body is in red, but not displayed here on github).

@geoffroyleconte
Copy link
Member Author

With my last commit:

julia> @code_warntype hess_op(nlp, x)
MethodInstance for NLPModels.hess_op(::DiagonalQNModel{Float64, Vector{Float64}, SimpleNLPModel{Float64, Vector{Float64}, NLPModelMeta{Float64, Vector{Float64}}}, NLPModelMeta{Float64, Vector{Float64}}, LinearOperators.DiagonalQN{Float64, Int64, Vector{Float64}, LinearOperators.var"#84#85"{Vector{Float64}}}}, ::Vector{Float64})
  from hess_op(nlp::QuasiNewtonModel, x::AbstractVector; kwargs...) in NLPModelsModifiers at C:\Users\Geoffroy Leconte\.julia\dev\NLPModelsModifiers\src\quasi-newton.jl:155
Arguments
  #self#::Core.Const(NLPModels.hess_op)
  nlp::DiagonalQNModel{Float64, Vector{Float64}, SimpleNLPModel{Float64, Vector{Float64}, NLPModelMeta{Float64, Vector{Float64}}}, NLPModelMeta{Float64, Vector{Float64}}, LinearOperators.DiagonalQN{Float64, Int64, Vector{Float64}, LinearOperators.var"#84#85"{Vector{Float64}}}}
  x::Vector{Float64}
Body::LinearOperators.DiagonalQN{Float64, Int64, Vector{Float64}, LinearOperators.var"#84#85"{Vector{Float64}}}       
1%1 = Core.NamedTuple()::Core.Const(NamedTuple())
│   %2 = Base.pairs(%1)::Core.Const(Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}())
│   %3 = NLPModelsModifiers.:(var"#hess_op#20")(%2, #self#, nlp, x)::LinearOperators.DiagonalQN{Float64, Int64, Vector{Float64}, LinearOperators.var"#84#85"{Vector{Float64}}}
└──      return %3

(no red).

@github-actions
Copy link
Contributor

Package name latest stable
ADNLPModels.jl
AmplNLReader.jl
CUTEst.jl
CaNNOLeS.jl
DCI.jl
FletcherPenaltySolver.jl
JSOSolvers.jl
LLSModels.jl
NLPModelsIpopt.jl
NLPModelsJuMP.jl
NLPModelsTest.jl
Percival.jl
QuadraticModels.jl
SolverBenchmark.jl
SolverTools.jl

Copy link
Member

@tmigot tmigot left a comment

Choose a reason for hiding this comment

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

Thanks @geoffroyleconte for the new models!
If you use these QuasiNewtonModel could you add later a short tutorial about it in the package documentation?

@geoffroyleconte geoffroyleconte merged commit 517837a into JuliaSmoothOptimizers:main Jan 26, 2023
@geoffroyleconte
Copy link
Member Author

Sure. You mean improving the doc of each individual QN model or an example in the /docs (I can see that there is no tutorial page on this package but I can add one later)?

@tmigot
Copy link
Member

tmigot commented Jan 27, 2023

Yes, a tutorial-like page for the QN models. We are starting from scratch here, so anything will be helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants