RandomSubsample#

class bayesflow.adapters.transforms.RandomSubsample(sample_size: int | float, axis: int = -1)[source]#

Bases: ElementwiseTransform

A transform that takes a random subsample of the data within an axis.

Examples

>>> adapter = bf.Adapter().random_subsample("x", sample_size=3, axis=-1)
forward(data: ndarray, **kwargs) ndarray[source]#
inverse(data: ndarray, **kwargs) ndarray[source]#
get_config() dict[source]#
__call__(data: ndarray, inverse: bool = False, **kwargs) ndarray#

Call self as a function.

classmethod from_config(config: dict, custom_objects=None)#
log_det_jac(data: ndarray, inverse: bool = False, **kwargs) ndarray | None#