-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
Occasionally it is useful to return an extra "payload" along with values and gradients. Examples include
- generated quantities (eg in Stan),
- simulated interim data (eg for indirect inference)
Before fixing the API for a longer time, some thought should be given to supporting this.
Here is what I am thinking of:
-
Define accessors
get_logdensity,get_gradient,get_payloadfor values returned bylogdensityandlogdensity_and_gradient, -
make the latter two return some lightweight container, which has default methods for the above,
-
with
get_payloaddefaulting tonothing.
The accessors can be introduced at little cost, some dubious workarounds can make the rest non-breaking (dispatch on NTuple) but perhaps a deprecation cycle would be better.
Metadata
Metadata
Assignees
Labels
No labels