question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve documentation on InferenceData.map

See original GitHub issue
  1. Is InferenceData.map always done elementwise or is some sort of reduction applied?
  2. What is the function signature (particularly input shape and output shape) expected for a function passed to map? Currently, the docs just say “fun: callable / Function to be applied to each group.”

For example, suppose you want to evaluate a new function of the model parameters (iterated for each step in each chain). Often, one might use pymc3.Deterministic to add those to the compute graph during model sampling, but I imagine that InferenceData.map might be a nice way to run such calculations without having to build it into the original compute graph at training time. I think a couple of examples and some guardrails on what fun ought to be might improve the usability here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
kyleabeauchampcommented, Jul 5, 2020

FYI, I was able to figure out my use case combining arviz + xarray + sklearn metrics. I spent several hours staring at the docs for wrap_xarray_ufunc and eventually was able to identify the following pattern:

xr.apply_ufunc(f, y, yhat, input_core_dims=[[dim], [dim]], vectorize=True)
0reactions
AlexAndorracommented, Jun 23, 2020

Closing, as the doc improvement has been merged and released in 0.9.0, but feel free to reopen if needed 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

arviz.InferenceData.map — ArviZ dev documentation
Applies fun groupwise to the selected InferenceData groups and overwrites the group with the result of the function. Parameters. funcallable. Function to be ......
Read more >
InferenceData extensions [Discussion] · Issue #1066 - GitHub
InferenceData objects are central to ArviZ, and even though a common subset of tasks ... Improve documentation on InferenceData.map #1252.
Read more >
arviz.InferenceData.rename_dims
Returns a new object with renamed dimensions only. rename. Perform xarray renaming of variable and dimensions on all groups of an InferenceData object....
Read more >
Inference — PyMC3 3.11.5 documentation
InferenceData, or MultiTrace), or a list of list containing dicts from find_MAP() or points. The number of traces should be equal to the...
Read more >
Google Cloud documentation
Develop ASP.NET apps in Visual Studio on Google Cloud. Workflows. Orchestrate and automate Google Cloud and HTTP-based API services with serverless workflows.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found