class_docstr: Parallel expected improvement acquisition function.
  
  Computes the q-EI from a multivariate observation model. This is also known as
  batch expected improvement.
  
  Requires that `predictive_distribution` has a `sample` method.
  
  #### Examples
  
  Build and evaluate a Parallel Expected Improvement acquisition function.
  
  ```python
  import numpy as np
  import tensorflow_probability as tfp
  
  tfd = tfp.distributions
  tfpk = tfp.math.psd_kernels
  tfp_acq = tfp.experimental.bayesopt.acquisition
  
  # Sample 10 20-dimensional index points and associated observations.
  index_points = np.random.uniform(size=[10, 20])
  observations = np.random.uniform(size=[10])
  
  # Build a Student T Process regression model conditioned on observed data.
  dist = tfd.StudentTProcessRegressionModel(
      kernel=tfpk.ExponentiatedQuadratic(),
      df=5.,
      observation_index_points=index_points,
      observations=observations)
  
  # Define a Parallel Expected Improvement acquisition function.
  stp_pei = tfp_acq.ParallelExpectedImprovement(
      predictive_distribution=dist,
      observations=observations,
      num_samples=10_000)
  
  # Evaluate the acquisition function at a new set of index points.
  pred_index_points = np.random.uniform(size=[6, 20])
  acq_fn_vals = stp_pei(pred_index_points)  # Has shape [6].
  ```
class_docstr_tok: ["Parallel","expected","improvement","acquisition","function",".","Computes","the","q-EI","from","a","multivariate","observation","model",".","This","is","also","known","as","batch","expected","improvement",".","Requires","that","`","predictive_distribution","`","has","a","`","sample","`","method",".","#","#","#","#","Examples","Build","and","evaluate","a","Parallel","Expected","Improvement","acquisition","function",".","``","`","python","import","numpy","as","np","import","tensorflow_probability","as","tfp","tfd","=","tfp.distributions","tfpk","=","tfp.math.psd_kernels","tfp_acq","=","tfp.experimental.bayesopt.acquisition","#","Sample","10","20-dimensional","index","points","and","associated","observations",".","index_points","=","np.random.uniform","(","size=","[","10",",","20","]",")","observations","=","np.random.uniform","(","size=","[","10","]",")","#","Build","a","Student","T","Process","regression","model","conditioned","on","observed","data",".","dist","=","tfd.StudentTProcessRegressionModel","(","kernel=tfpk.ExponentiatedQuadratic","(",")",",","df=5.",",","observation_index_points=index_points",",","observations=observations",")","#","Define","a","Parallel","Expected","Improvement","acquisition","function",".","stp_pei","=","tfp_acq.ParallelExpectedImprovement","(","predictive_distribution=dist",",","observations=observations",",","num_samples=10_000",")","#","Evaluate","the","acquisition","function","at","a","new","set","of","index","points",".","pred_index_points","=","np.random.uniform","(","size=","[","6",",","20","]",")","acq_fn_vals","=","stp_pei","(","pred_index_points",")","#","Has","shape","[","6","]",".","``","`"]
docstr: Constructs a Parallel Expected Improvement acquisition function.
  
  Args:
    predictive_distribution: `tfd.Distribution`-like, the distribution over
      observations at a set of index points. Must have a `sample` method.
    observations: `Float` `Tensor` of observations. Shape has the form
      `[b1, ..., bB, e]`, where `e` is the number of index points (such that
      the event shape of `predictive_distribution` is `[e]`) and
      `[b1, ..., bB]` is broadcastable with the batch shape of
      `predictive_distribution`.
    seed: PRNG seed; see tfp.random.sanitize_seed for details.
    exploration: Exploitation-exploration trade-off parameter.
    num_samples: The number of samples to use for the Parallel Expected
      Improvement approximation.
    transform_fn: Optional Python `Callable` that transforms objective values.
      This is used for optimizing a composite grey box function `g(f(x))`
      where `f` is our black box function and `g` is `transform_fn`.
docstr_tok: ["Constructs","a","Parallel","Expected","Improvement","acquisition","function",".","Args",":","predictive_distribution",":","`","tfd.Distribution","`","-like",",","the","distribution","over","observations","at","a","set","of","index","points",".","Must","have","a","`","sample","`","method",".","observations",":","`","Float","`","`","Tensor","`","of","observations",".","Shape","has","the","form","`","[","b1",",","...",",","bB",",","e","]","`",",","where","`","e","`","is","the","number","of","index","points","(","such","that","the","event","shape","of","`","predictive_distribution","`","is","`","[","e","]","`",")","and","`","[","b1",",","...",",","bB","]","`","is","broadcastable","with","the","batch","shape","of","`","predictive_distribution","`",".","seed",":","PRNG","seed",";","see","tfp.random.sanitize_seed","for","details",".","exploration",":","Exploitation-exploration","trade-off","parameter",".","num_samples",":","The","number","of","samples","to","use","for","the","Parallel","Expected","Improvement","approximation",".","transform_fn",":","Optional","Python","`","Callable","`","that","transforms","objective","values",".","This","is","used","for","optimizing","a","composite","grey","box","function","`","g","(","f","(","x",")",")","`","where","`","f","`","is","our","black","box","function","and","`","g","`","is","`","transform_fn","`","."]
code: def __init__(
      self,
      predictive_distribution,
      observations,
      seed=None,
      exploration=0.01,
      num_samples=100,
      transform_fn=None,
  ):
      """Constructs a Parallel Expected Improvement acquisition function.
  
      Args:
        predictive_distribution: `tfd.Distribution`-like, the distribution over
          observations at a set of index points. Must have a `sample` method.
        observations: `Float` `Tensor` of observations. Shape has the form
          `[b1, ..., bB, e]`, where `e` is the number of index points (such that
          the event shape of `predictive_distribution` is `[e]`) and
          `[b1, ..., bB]` is broadcastable with the batch shape of
          `predictive_distribution`.
        seed: PRNG seed; see tfp.random.sanitize_seed for details.
        exploration: Exploitation-exploration trade-off parameter.
        num_samples: The number of samples to use for the Parallel Expected
          Improvement approximation.
        transform_fn: Optional Python `Callable` that transforms objective values.
          This is used for optimizing a composite grey box function `g(f(x))`
          where `f` is our black box function and `g` is `transform_fn`.
      """
      self._exploration = exploration
      self._num_samples = num_samples
      self._transform_fn = transform_fn
      super(ParallelExpectedImprovement, self).__init__(
          predictive_distribution=predictive_distribution,
          observations=observations,
          seed=seed,
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.experimental.bayesopt.acquisition import acquisition_function
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import samplers
label_desc: Use image node_id 1 to create a new ParallelExpectedImprovement object from inherited base classes: acquisition_function with example: obj = ParallelExpectedImprovement(predictive_distribution, observations, seed, exploration, num_samples, transform_fn)