Thanks for the recommendations! I ended up manually coding the gradient and hessian for the function and using the ForwardDiffChainRules.jl package to enforce this rule, now it’s working.
Thanks for the recommendations! I ended up manually coding the gradient and hessian for the function and using the ForwardDiffChainRules.jl package to enforce this rule, now it’s working.