RandomPolicy

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

Bases: probnum.quad.solvers.policies._policy.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.

Methods Summary

__call__(bq_state)

Find nodes according to the policy.

Methods Documentation

__call__(bq_state)[source]

Find nodes according to the policy. :type bq_state: BQState :param bq_state: State of the BQ belief.

Returns

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

Return type

nodes