Open MaxenceGollier opened 1 month ago
I probably didn’t implement counters and structure because diagonal QN operators are only used in the nonsmooth solvers at this point. You are right that they should be added.
@MaxenceGollier thanks for the issue. For the other quasi-Newton models, this is the line that adds the counters field:
It is a macro that redirects the counters field to the original nlp.
I agree with @dpo it makes sense to have Hessian functions implemented for AbstractDiagonalQNModel
@MaxenceGollier would you have some time to open two PRs for these two issues?
@MaxenceGollier thanks for the issue. For the other quasi-Newton models, this is the line that adds the counters field:
It is a macro that redirects the counters field to the original nlp.
I agree with @dpo it makes sense to have Hessian functions implemented for AbstractDiagonalQNModel
I don't get it, This macro does not seem to work as if nlp is type QuasiNewtonNLP, then nlp.counters doesn't exist, what should I modify ? Just adding the field is not correct ? (as I did in #122)
I have an issue for adding the hessian structure with the field nnzh of nlp.meta, I opened an issue in NLPModels.jl
@MaxenceGollier thanks for the issue. For the other quasi-Newton models, this is the line that adds the counters field:
It is a macro that redirects the counters field to the original nlp.
I agree with @dpo it makes sense to have Hessian functions implemented for AbstractDiagonalQNModel
Actually, wouldn't this macro be more appropriate ?
macro add_counters(Model, inner)
:($Model.counters = $Model.$inner.counters)
end
since we want to access to the field counters
with AbstractDiagonalQNModel
type
Actually, the @default_counters
macro does more than just accessing the inner counters see
https://github.com/JuliaSmoothOptimizers/NLPModels.jl/blob/b8454fbb8bb1399c1c88b7597db88756536e501f/src/nlp/utils.jl#L119 That's why I am really trying to make it work.
Just for reference, the meta discussion is connected to https://github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl/issues/29
I am trying to benchmark solvers on a Diagonal Quasi-Newton Model. I get two issues:
type DiagonalQNModel has no field counters
MethodError : no method matching hess_structure!(::NLPModelsModifiers.DiagonalQNModel{...},...)
Here is an example
There is no reason for not having a
hess_structure!
method at least for the DiagonalQNModel type because it is trivial. I can also add the counters as a field of the different structures if you think it is appropriate.