You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use a cg::CGAtomicGenericModel to compute the Hessian of a CppAD::ADFun. For example in this schematic code:
...
CGAtomicGenericModel<double> atomic_model;
ADFun<double> fun;
...
std::vector<AD<double>> X, Y, Z;
Y = atomic_model(X, Y);
Z = Y * Y; // some nonlinear functionfun(X, Z);
...
fun.sparse_hes(x, w, hess_subset, hess_pattern, "cppad.general", hes_work);
This would result in the following error:
cppad-20190806 error from a known source:
Second-order reverse mode failed: py[2*i] (i=0...m) must be zero.
Error detected by false result for
ret != 1
at line 552 in the file
/Users/rguseino/sdk/cppadcodegen/include/cppad/cg/model/functor_generic_model.hpp
Assertion failed: (false), function Default, file /Users/rguseino/sdk/cppad/include/cppad/utility/error_handler.hpp, line 206.
In case Z is linear in Y, the error is not reproduced.
Does this mean that for now CGAtomicGenericModel is not supposed to be used in such scenario? Is there a workaround for this problem?
P.S. This happens in my large project but, if necessary, I can write simple code to reproduce this behavior.
The text was updated successfully, but these errors were encountered:
I am trying to use a cg::CGAtomicGenericModel to compute the Hessian of a CppAD::ADFun. For example in this schematic code:
This would result in the following error:
In case Z is linear in Y, the error is not reproduced.
Does this mean that for now CGAtomicGenericModel is not supposed to be used in such scenario? Is there a workaround for this problem?
P.S. This happens in my large project but, if necessary, I can write simple code to reproduce this behavior.
The text was updated successfully, but these errors were encountered: