1010from probnum .quad .integration_measures import IntegrationMeasure , LebesgueMeasure
1111from probnum .quad .kernel_embeddings import KernelEmbedding
1212from probnum .quad .solvers ._bq_state import BQIterInfo , BQState
13+ from probnum .quad .solvers .acquisition_functions import WeightedPredictiveVariance
1314from probnum .quad .solvers .belief_updates import BQBeliefUpdate , BQStandardBeliefUpdate
1415from probnum .quad .solvers .initial_designs import InitialDesign , LatinDesign , MCDesign
15- from probnum .quad .solvers .policies import Policy , RandomPolicy , VanDerCorputPolicy
16+ from probnum .quad .solvers .policies import (
17+ Policy ,
18+ RandomMaxAcquisitionPolicy ,
19+ RandomPolicy ,
20+ VanDerCorputPolicy ,
21+ )
1622from probnum .quad .solvers .stopping_criteria import (
1723 BQStoppingCriterion ,
1824 ImmediateStop ,
@@ -38,7 +44,7 @@ class BayesianQuadrature:
3844 Parameters
3945 ----------
4046 kernel
41- The kernel used for the GP model.
47+ The kernel used for the Gaussian process model.
4248 measure
4349 The integration measure.
4450 policy
@@ -139,6 +145,9 @@ def from_problem(
139145 num_initial_design_nodes : Optional[IntLike]
140146 The number of nodes created by the initial design. Defaults to
141147 ``input_dim * 5`` if an initial design is given.
148+ us_rand_num_candidates : Optional[IntLike]
149+ The number of candidate nodes used by the policy 'us_rand'. Defaults
150+ to 1e2.
142151
143152 Returns
144153 -------
@@ -175,6 +184,7 @@ def from_problem(
175184 num_initial_design_nodes = options .get (
176185 "num_initial_design_nodes" , int (5 * input_dim )
177186 )
187+ us_rand_num_candidates = options .get ("us_rand_num_candidates" , int (1e2 ))
178188
179189 # Set up integration measure
180190 if domain is None and measure is None :
@@ -198,6 +208,12 @@ def from_problem(
198208 policy = RandomPolicy (batch_size , measure .sample )
199209 elif policy == "vdc" :
200210 policy = VanDerCorputPolicy (batch_size , measure )
211+ elif policy == "us_rand" :
212+ policy = RandomMaxAcquisitionPolicy (
213+ batch_size = 1 ,
214+ acquisition_func = WeightedPredictiveVariance (),
215+ n_candidates = us_rand_num_candidates ,
216+ )
201217 else :
202218 raise NotImplementedError (f"The given policy ({ policy } ) is unknown." )
203219
0 commit comments