Skip to content

pydvl.valuation.samplers.utils

StochasticSamplerMixin

StochasticSamplerMixin(*args, seed: Seed | None = None, **kwargs)

Mixin class for samplers which use a random number generator.

Source code in src/pydvl/valuation/samplers/utils.py
def __init__(self, *args, seed: Seed | None = None, **kwargs):
    super().__init__(*args, **kwargs)
    self._rng = np.random.default_rng(seed)