JuliaSmoothOptimizers / JuliaSmoothOptimizers/OptimizationProblems.jl
AD error with rat42
- Dominant language
- Julia
- Stars
- 90
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
Even though the AD backend for the residual Jacobian is defined, it returns an empty Jacobian:
```julia
julia> rat42_nls = rat42(; use_nls = true)
ADNLSModel - Nonlinear least-squares model with automatic differentiation backend ADModelBackend{
ForwardDiffADGradient,
ForwardDiffADHvprod,
EmptyADbackend,
EmptyADbackend,
EmptyADbackend,
SparseADHessian,
EmptyADbackend,
ForwardDiffADHvprod,
ForwardDiffADJprod,
ForwardDiffADJtprod,
SparseADJacobian,
SparseADHessian,
}
julia> jac_structure(rat42_nls)
(Int64[], Int64[])
julia> x = [99.94710393753867, 1.6483148108416925, -12.429444473714828]
julia> jac(rat42_nls, x)
0×3 SparseMatrixCSC{Float64, Int64} with 0 stored entries
```
There is also an error with the gradient of the NLP model:
```julia
julia> rat42_model = rat42()
ADNLPModel - Model with automatic differentiation backend ADModelBackend{
ForwardDiffADGradient,
ForwardDiffADHvprod,
EmptyADbackend,
EmptyADbackend,
EmptyADbackend,
SparseADHessian,
EmptyADbackend,
}
julia> obj(rat42_model, x)
9111.7101
julia> grad(rat42_model, x)
3-element Vector{Float64}:
NaN
NaN
NaN
```
@amontoison @tmigot Any ideas?
Contributor guide
Assessment
This issue has not been assessed yet.