Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing returned values in VarInfo. #529

Closed
yebai opened this issue Sep 1, 2023 · 0 comments
Closed

Storing returned values in VarInfo. #529

yebai opened this issue Sep 1, 2023 · 0 comments

Comments

@yebai
Copy link
Member

yebai commented Sep 1, 2023

We have debated for length about how to handle returned values from a DynamicPPL model, and use that as a way to store extra non-parameter model variables (e.g. transformed variables and generated quantities; see here). One straightforward approach is to introduce an extra field in SimpleVarInfo, e.g.

struct SimpleVarInfo
   logp
   values
   ret_values
   transformation
end

We can safely compress the ret_values and values into one field and skip ret_values during inference.

More generally, the returned value can be a closure, allowing us to easily perform post-inference tasks, e.g., prediction.

@yebai yebai closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant