class_docstr: Performs Bayesian Optimization using a Gaussian Process as an
  emulator for the unknown function.
class_docstr_tok: ["Performs","Bayesian","Optimization","using","a","Gaussian","Process","as","an","emulator","for","the","unknown","function","."]
docstr: Selects `num_acquisitions` query points at which to query the
  original function by Thompson sampling.
  
  :param int num_acquisitions: the number of points to generate
  :param dict opt_params: additional parameters for optimization
      routines
  :return: a tensor of points to evaluate `loss` at
  :rtype: torch.Tensor
docstr_tok: ["Selects","`","num_acquisitions","`","query","points","at","which","to","query","the","original","function","by","Thompson","sampling",".",":","param","int","num_acquisitions",":","the","number","of","points","to","generate",":","param","dict","opt_params",":","additional","parameters","for","optimization","routines",":","return",":","a","tensor","of","points","to","evaluate","`","loss","`","at",":","rtype",":","torch.Tensor"]
code: def acquire_thompson(self, num_acquisitions=1, **opt_params):
      """Selects `num_acquisitions` query points at which to query the
      original function by Thompson sampling.
  
      :param int num_acquisitions: the number of points to generate
      :param dict opt_params: additional parameters for optimization
          routines
      :return: a tensor of points to evaluate `loss` at
      :rtype: torch.Tensor
      """
  
      # Initialize the return tensor
      X = self.gpmodel.X
      X = torch.empty(
          num_acquisitions, *X.shape[1:], dtype=X.dtype, device=X.device
      )
  
      for i in range(num_acquisitions):
          sampler = self.gpmodel.iter_sample(noiseless=False)
          x, _ = self.opt_differentiable(sampler, **opt_params)
          X[i, ...] = x
  
      return X
  
file_path: pyro/examples/contrib/oed/gp_bayes_opt.py
imports: import torch
  import torch.autograd
  import torch.optim
  from torch.distributions import transform_to
  import pyro.contrib.gp
  import pyro.optim
  from pyro.infer import TraceEnum_ELBO
label_desc: Use image node_id 5 for calling the GPBayesOptimizer obj's underlying member method code with example usage: obj.acquire_thompson(num_acquisitions) and returns: X