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

Add reset function for Diagonal QN operators, fix bug SpectralGradient #266

Merged
merged 2 commits into from
Jan 26, 2023

Conversation

geoffroyleconte
Copy link
Member

@geoffroyleconte geoffroyleconte commented Jan 25, 2023

Following JuliaSmoothOptimizers/NLPModelsModifiers.jl#94, I added reset! functions that restore the QN operators to the identity operator.

At the same time, I spotted a bug with SpectralGradient where the push was not updating d in the closure prod = (res, v, α, β) -> mulSquareOpDiagonal!(res, d, v, α, β) (because d was a Real).
I fixed it by changing d to [σ] so that modifying d[1] modifies mulSquareOpDiagonal!(res, d, v, α, β) accordingly.

This modifies the way we update a SpectralGradient: we have to do op.d[1] = 2.0 instead of op.d = 2.0, but since we are supposed to update this operator with push!, this should not break code.

Does the adding of the reset! function requires a new minor release 2.6.0, or can we stick to a patch 2.5.1?

@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Base: 97.38% // Head: 97.42% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (2b9fa2b) compared to base (f2fe71c).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #266      +/-   ##
==========================================
+ Coverage   97.38%   97.42%   +0.03%     
==========================================
  Files          14       14              
  Lines         996     1009      +13     
==========================================
+ Hits          970      983      +13     
  Misses         26       26              
Impacted Files Coverage Δ
src/DiagonalHessianApproximation.jl 95.34% <100.00%> (+2.01%) ⬆️

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

github-actions bot commented Jan 25, 2023

Package name latest stable
CaNNOLeS.jl
DCISolver.jl
FletcherPenaltySolver.jl
JSOSolvers.jl
Krylov.jl
NLPModels.jl
NLPModelsModifiers.jl
PROPACK.jl
Percival.jl
QuadraticModels.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.

Looks great, thanks! After the two suggested changes, it's good for me.

src/DiagonalHessianApproximation.jl Outdated Show resolved Hide resolved
src/DiagonalHessianApproximation.jl Outdated Show resolved Hide resolved
Co-authored-by: tmigot <tangi.migot@gmail.com>
@geoffroyleconte geoffroyleconte merged commit 69e611b into JuliaSmoothOptimizers:main Jan 26, 2023
@geoffroyleconte geoffroyleconte deleted the reset-qn branch January 26, 2023 16:28
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