Open tmigot opened 3 years ago
@AntoninKns
All issues have been fixed apart for the jprod_residual!
and jtprod_residual!
.
I just tried to run your problems with the JSOSolvers and found I needed:
function NLPModels.jtprod_residual!(model::BundleAdjustmentModel{Float64, Vector{Float64}}, x, v, jv)
mul!(jv, NLPModels.jac_residual(model, x)', v)
end
function NLPModels.jprod_residual!(model::BundleAdjustmentModel{Float64, Vector{Float64}}, x, v, jv)
mul!(jv, NLPModels.jac_residual(model, x), v)
end
Not sure if you'd rather do something smarter but it's a quick workaround.
Hi @AndrewLister-STFC ! Thank you for your interest and sorry for the delay of my response as we are understaffed at the moment.
You are right it is indeed a good workaround. I think long term we would have hope for a more efficient solution that would not evaluate (and therefore store) the Jacobian residual. My suggestion would be to combine this with ADNLPModel ( adapting this tuto https://jso.dev/ADNLPModels.jl/dev/mixed/ ) that will use AD for these operations.
Maybe this solution works with https://github.com/JuliaSmoothOptimizers/BundleAdjustmentModels.jl/pull/84 only.
Thanks @AntoninKns for this great repo!
I was checking the
BundleAdjustmentModel
, which follows the NLSModel API, and I have a couple of comments:jac_structure_residual!
andjac_coord_residual!
and notjac_structure!
L.159 andjac_coord!
L.196.jprod_residual!
, andjtprod_residual!
would be very useful.BundleAdjustmentModel
doesn't return any second-order information on the residual.BundleAdjustmentModel
L.5 might be misleading since the model is a nonlinear least-square optimization problem.