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
Is your feature request related to a problem? Please describe.
As noted in the docs directly calling adjoint_sensitivities can be more efficient, and it is what we for example do in PEtab.jl. However, as adjoint_sensitivities does not return any retcode for adj_sol it is currently not possible when, for example doing parameter estimation, to catch gradient evaluation failures. As the forward problem can often be easier to solve, being able to catch the error in the forward-solve is not enough.
I have also seen questions about this on Slack in the sciml-bridged channel.
Describe the solution you’d like
I do not know exactly how to solve this, but one option could be to allow _adjoint_sensitivities to also return adj_sol, then for the function adjoint_sensitivities have a kwarg like retadjsol=false that by default is false and return as currently du, dp, but if true also returns adj_sol.
Describe alternatives you’ve considered
An alternative is in for example packages like PEtab.jl to copy in the code from _adjoint_sensitivities for each method, however, this is not feasible to maintain. It is also possible to generally capture if a warning was thrown, but accessing the retcode would be a more convenient and less hacky solution.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
As noted in the docs directly calling
adjoint_sensitivities
can be more efficient, and it is what we for example do in PEtab.jl. However, asadjoint_sensitivities
does not return anyretcode
foradj_sol
it is currently not possible when, for example doing parameter estimation, to catch gradient evaluation failures. As the forward problem can often be easier to solve, being able to catch the error in the forward-solve is not enough.I have also seen questions about this on Slack in the sciml-bridged channel.
Describe the solution you’d like
I do not know exactly how to solve this, but one option could be to allow
_adjoint_sensitivities
to also returnadj_sol
, then for the functionadjoint_sensitivities
have akwarg
likeretadjsol=false
that by default is false and return as currentlydu, dp
, but if true also returnsadj_sol
.Describe alternatives you’ve considered
An alternative is in for example packages like PEtab.jl to copy in the code from
_adjoint_sensitivities
for each method, however, this is not feasible to maintain. It is also possible to generally capture if a warning was thrown, but accessing theretcode
would be a more convenient and less hacky solution.The text was updated successfully, but these errors were encountered: