Skip to content

AD error with rat42 #338

@dpo

Description

@dpo

Even though the AD backend for the residual Jacobian is defined, it returns an empty Jacobian:

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> 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions