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

Pre computation support #29

Open
OriolAbril opened this issue Oct 12, 2024 · 0 comments
Open

Pre computation support #29

OriolAbril opened this issue Oct 12, 2024 · 0 comments

Comments

@OriolAbril
Copy link
Member

In arviz-plots we use stats_kwargs argument with datasets as values to indicate we don't want a computation to happen but instead we want the provided values to be used. I think we should make this possible here too as it can significantly reduce the computational cost, for example, computing multiple hdi intervals currently recomputes the kde for each interval; (in current arviz) we use psis log weights in multiple places, but the ability to provide log weights that have been already computed is quite limited...

The initial goal of this issue is to discuss what API we could use for that. I think it would be fine to consider this a somewhat advanced feature, so that manual precomputation is required instead of having the kde that was computed within hdi to be accessible to the user so it can be provided in a future call to hdi for example.

Some ideas:

  • Have a precomputed keyword argument that takes a dictionary of keywords representing intermediate results and their values as datasets/dataarrays/arrays
  • add explicit keyword arguments for each intermediate result where providing precomputed results is supported. We'd have to look into potential argument name clashes.
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