sample
- sample(model, sampler, *, max_samples=None, frequency=None, features='s', key=None, **kwargs)[source]
Explore the parameter space of a model using a specified sampling engine.
This unified router executes the sampling algorithm using a standardized state-machine loop (init, step, terminate), supporting both one-shot and adaptive active learning strategies frictionlessly.
- Parameters:
model (Model) – The parametric model to sample.
sampler (AbstractSampler) – The sampling algorithm to use.
max_samples (int | None, default=None) – The maximum number of samples to generate. For one-shot samplers, this is the exact number generated. For adaptive samplers, this acts as a computational budget. If None, adaptive samplers run until convergence.
frequency (Frequency | None, default=None) – The frequency sweep for feature evaluation.
features (EvaluatorLike | None, default=None) – The specific circuit features to extract.
key (Array | None, default=None) – JAX PRNG key for stochastic samplers.
**kwargs – Additional arguments passed to the underlying evaluators.
- Returns:
The comprehensive result object containing the original continuous model and batched execution states.
- Return type: