sbi icon indicating copy to clipboard operation
sbi copied to clipboard

Add `sample_batched` and `log_prob_batched` to posteriors

Open manuelgloeckler opened this issue 1 year ago • 1 comments

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

manuelgloeckler avatar Mar 13 '24 16:03 manuelgloeckler

#1153 implemets this

manuelgloeckler avatar May 28 '24 07:05 manuelgloeckler