Simulator#
- class bayesflow.simulators.Simulator[source]#
Bases:
object
- rejection_sample(batch_shape: tuple[int, ...], predicate: Callable[[dict[str, ndarray]], ndarray], *, axis: int = 0, sample_size: int = None, **kwargs) dict[str, ndarray] [source]#
- sample_batched(batch_shape: tuple[int, ...], *, sample_size: int, **kwargs)[source]#
Sample the desired number of simulations in smaller batches.
Limited resources, especially memory, can make it necessary to run simulations in smaller batches. The number of samples per simulated batch is specified by sample_size.