RandomPolicy

class probnum.quad.RandomPolicy(sample_func, batch_size, rng=Generator(PCG64) at 0x7F92DB009D60)[source]

Bases: Policy

Random sampling from an objective.

Parameters
  • sample_func (Callable) – The sample function. Needs to have the following interface: sample_func(batch_size: int, rng: np.random.Generator) and return an array of shape (batch_size, n_dim).

  • batch_size (int) – Size of batch of nodes when calling the policy once.

  • rng (Generator) –

Return type

None

Methods Summary

__call__(bq_state)

Find nodes according to the policy.

Methods Documentation

__call__(bq_state)[source]

Find nodes according to the policy.

Parameters

bq_state (BQState) – State of the BQ belief.

Returns

shape=(batch_size, input_dim) – Nodes found according to the policy.

Return type

nodes