JuliaSmoothOptimizers / ADNLPModels.jl

Other
29 stars 12 forks source link

Full support of sparse AD for NLS models #239

Closed amontoison closed 6 days ago

amontoison commented 3 weeks ago

@tmigot Can you help me with it?

github-actions[bot] commented 3 weeks ago
Package name latest stable
CaNNOLeS.jl
DCISolver.jl
DerivativeFreeSolvers.jl
JSOSolvers.jl
NLPModelsIpopt.jl
OptimalControl.jl
OptimizationProblems.jl
Percival.jl
QuadraticModels.jl
SolverBenchmark.jl
SolverTools.jl
tmigot commented 3 weeks ago

@amontoison I keep this in my list. Could you rebase the branch?

amontoison commented 3 weeks ago

@amontoison I keep this in my list. Could you rebase the branch?

@tmigot Done

tmigot commented 1 week ago

@amontoison I took care of the ADNLPModel-stuff, just rest to fix hess_structure_residual! and hess_coord_residual! for sparse backend.

amontoison commented 1 week ago

@amontoison I took care of the ADNLPModel-stuff, just rest to fix hess_structure_residual! and hess_coord_residual! for sparse backend.

@tmigot I think we need to create the backend for residual_hessian with different arguments (f(x) = 0 and c(x) = F(x)). You probably know how to fix that.

amontoison commented 1 week ago

@tmigot Tu sais à quoi ça sert ces lignes? https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl/commit/d37a9a1c27069eb2741bf73686d08ca5d27501d0#diff-a1616586d29af268a473ea5c9c5ea6d09aa5f0de50e914a9d0bedc8d4f7bb59eR92-R99

tmigot commented 1 week ago

@tmigot Tu sais à quoi ça sert ces lignes? d37a9a1#diff-a1616586d29af268a473ea5c9c5ea6d09aa5f0de50e914a9d0bedc8d4f7bb59eR92-R99

C'est pour couvrir le cas où le "backend" fourni par l'utilisateur est un NLPModel. Mais définir cette fonction

function get_residual_nnzj(nlp::AbstractNLPModel, nvar, nequ)
  nlp.nls_meta.nnzj
end

devrait être suffisant je pense.

amontoison commented 1 week ago

@tmigot All tests passed for Hessian but we probably need to update the API for jth_hess_residual.

tmigot commented 6 days ago

Thanks for fixing it. I think the implementation in AD&NLPModels of jth_residual_hess is not clear so I removed the additional implementation (https://github.com/JuliaSmoothOptimizers/NLPModels.jl/issues/466). It should work now