Open huanglangwen opened 5 years ago
I think we definitely want to make it so that people can just use the same function. However, there does need to be a nicer way to mix non-parameters with parameters. Maybe an array type.
But someone may prefer their own f_p
g_p
and g_u
compared to AD-generated one for reasons like analytical solutions, foreign language calls, etc. For the non-parameters, perhaps we need a new optional argument for f
?
Which function is missing? You don't need to rely on AD?
For example, f_p
is needed when doing back-integration in adjoint sensitivity. I can't find anyplace to specify them.
Oh, I didn't notice that. How about g_u
and g_p
because adjoint_sensitivities
only got dg
?
For discrete adjoints we only need dg. For continuous adjoints we only need g and dg.
Sorry, I can't get your point. How does the adjoint sensitivity equation go to your conclusion that only dg and g are needed?
dg=g_u
. For everything but continuous adjoints where g is dependent on p, this is sufficient. We could use a PR to add g_p to the integrand for continuous adjoints, right now that's just not supported.
Thank you.
I think it is better to pass in
f_p
,g_p
andg_u
explicitly for adjoint sensitivity analysis instead of relying on the parameterp
inf(du,u,p,t)
anddg(out,u,p,t)
. Becausep
can be used for other purposes like caching and storing configurations which are not for differentiation.