sbi
sbi copied to clipboard
Add `sample_batched` and `log_prob_batched` to posteriors
Description
The current posterior estimators only support a single x_o (or iid x_os), for sampling and log_prob.
This can be inefficient when we want to sample from a batch of x_o (or iid x_os) as it requires a for-loop.
Fix
The new DensityEstimators already implement the capability to evaluate and sample for batches.
To preserve the current behaviour of the posterior classes, we would instead add:
- sample_batched samples for a batch of x_o
- log_prob_batched log_probs for a batch of x_o
#1153 implemets this