AbstractAdaptiveSampler

class AbstractAdaptiveSampler(initial_models=10, batch_size=1)[source]

Bases: AbstractSampler

Adaptive samplers iterate until a budget is reached or convergence is met.

Parameters:
  • initial_models (int)

  • batch_size (int)

initial_models: int = 10
batch_size: int = 1
init(eval_fn, d, key, options)[source]

Initialize the sampler state and perform the first evaluations.

Return type:

SamplerState

terminate(state, target_N)[source]

Determine whether the sampling loop should stop.

Parameters:
  • state (SamplerState)

  • target_N (int)

Return type:

bool

abstractmethod step(eval_fn, d, state, key, options)

Perform one iteration of the sampling algorithm.

Parameters:
Return type:

SamplerState