-
Notifications
You must be signed in to change notification settings - Fork 9
Add neval_hprod
incrementation
#87
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 neval_hprod
incrementation
#87
Conversation
Codecov ReportBase: 92.01% // Head: 92.04% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 92.01% 92.04% +0.02%
==========================================
Files 6 6
Lines 839 842 +3
==========================================
+ Hits 772 775 +3
Misses 67 67
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. |
3d9bc23
to
136364f
Compare
Following #86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paraynaud The more I think of it the more it feels slightly strange than nlp.model
counts hprod
evaluation while no hessian-products was used.
Maybe, we should just add a separate Counters
for the QuasiNewtonModel
?
So that neval_hprod(nlp)
would return 1, but neval_hprod(nlp.model)=0
.
Co-authored-by: tmigot <tangi.migot@gmail.com>
I don't agree, since we use the quasi-Newton operator within |
I am not sure to fully understand. Let's try to clarify, we have a
and we do
With your PR currently
because the LBFGSModel counter is synced with the nlp (actually, I think it would be accurate to have
|
I may have been confusing with LBFGS, which is a LBFGSModel used in trunk and not the inverse LBFGS linesearch from JSOSolvers. I use: nlp = ADNLPModel(f, x0)
model = LBFGSModel(nlp)
ges = trunk(model)
correct!
I did not think about it this way and I get your point. A suggestion: maybe we can link the |
Yes, that would work. If I understand correctly, you plan to do something like this:
? Do not hesitate to add this as a unit test:
|
@tmigot I gave up writing it as NLPModels.neval_hprod(nlp::QuasiNewtonModel) = nlp.op.nprod so I wrote it as NLPModels.neval_hprod(nlp::LBFGSModel) = nlp.op.nprod
NLPModels.neval_hprod(nlp::LSR1Model) = nlp.op.nprod and it behaves accordingly to our discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feared it was going a large PR, so good job for keeping it concise. Looks good for me, thanks!
No description provided.