docstr: Parallel Log Expected Hypervolume Improvement supporting m>=2 outcomes.
  
  See [Ament2023logei]_ for details and the methodology behind the LogEI family of
  acquisition function. Line-by-line differences to the original differentiable
  expected hypervolume formulation of [Daulton2020qehvi]_ are described via inline
  comments in `forward`.
  
  Example:
      >>> model = SingleTaskGP(train_X, train_Y)
      >>> ref_point = [0.0, 0.0]
      >>> acq = qLogExpectedHypervolumeImprovement(model, ref_point, partitioning)
      >>> value = acq(test_X)
  
  Args:
      model: A fitted model.
      ref_point: A list or tensor with `m` elements representing the reference
          point (in the outcome space) w.r.t. to which compute the hypervolume.
          This is a reference point for the objective values (i.e. after
          applying`objective` to the samples).
      partitioning: A `NondominatedPartitioning` module that provides the non-
          dominated front and a partitioning of the non-dominated space in hyper-
          rectangles. If constraints are present, this partitioning must only
          include feasible points.
      sampler: The sampler used to draw base samples. If not given,
          a sampler is generated using `get_sampler`.
      objective: The MCMultiOutputObjective under which the samples are evaluated.
          Defaults to `IdentityMultiOutputObjective()`.
      constraints: A list of callables, each mapping a Tensor of dimension
          `sample_shape x batch-shape x q x m` to a Tensor of dimension
          `sample_shape x batch-shape x q`, where negative values imply
          feasibility. The acquisition function will compute expected feasible
          hypervolume.
      X_pending: A `batch_shape x m x d`-dim Tensor of `m` design points that have
          points that have been submitted for function evaluation but have not yet
          been evaluated. Concatenated into `X` upon forward call. Copied and set
          to have no gradient.
      eta: The temperature parameter for the sigmoid function used for the
          differentiable approximation of the constraints. In case of a float the
          same eta is used for every constraint in constraints. In case of a
          tensor the length of the tensor must match the number of provided
          constraints. The i-th constraint is then estimated with the i-th
          eta value.
      fat: Toggles the logarithmic / linear asymptotic behavior of the smooth
          approximation to the ReLU and the maximum.
      tau_relu: Temperature parameter controlling the sharpness of the
          approximation to the ReLU over the `q` candidate points. For further
          details, see the comments above the definition of `TAU_RELU`.
      tau_max: Temperature parameter controlling the sharpness of the
          approximation to the `max` operator over the `q` candidate points.
          For further details, see the comments above the definition of `TAU_MAX`.
docstr_tok: ["Parallel","Log","Expected","Hypervolume","Improvement","supporting","m",">","=2","outcomes",".","See","[","Ament2023logei","]","_","for","details","and","the","methodology","behind","the","LogEI","family","of","acquisition","function",".","Line-by-line","differences","to","the","original","differentiable","expected","hypervolume","formulation","of","[","Daulton2020qehvi","]","_","are","described","via","inline","comments","in","`","forward","`",".","Example",":",">",">",">","model","=","SingleTaskGP","(","train_X",",","train_Y",")",">",">",">","ref_point","=","[","0.0",",","0.0","]",">",">",">","acq","=","qLogExpectedHypervolumeImprovement","(","model",",","ref_point",",","partitioning",")",">",">",">","value","=","acq","(","test_X",")","Args",":","model",":","A","fitted","model",".","ref_point",":","A","list","or","tensor","with","`","m","`","elements","representing","the","reference","point","(","in","the","outcome","space",")","w.r.t",".","to","which","compute","the","hypervolume",".","This","is","a","reference","point","for","the","objective","values","(","i.e",".","after","applying","`","objective","`","to","the","samples",")",".","partitioning",":","A","`","NondominatedPartitioning","`","module","that","provides","the","non-","dominated","front","and","a","partitioning","of","the","non-dominated","space","in","hyper-","rectangles",".","If","constraints","are","present",",","this","partitioning","must","only","include","feasible","points",".","sampler",":","The","sampler","used","to","draw","base","samples",".","If","not","given",",","a","sampler","is","generated","using","`","get_sampler","`",".","objective",":","The","MCMultiOutputObjective","under","which","the","samples","are","evaluated",".","Defaults","to","`","IdentityMultiOutputObjective","(",")","`",".","constraints",":","A","list","of","callables",",","each","mapping","a","Tensor","of","dimension","`","sample_shape","x","batch-shape","x","q","x","m","`","to","a","Tensor","of","dimension","`","sample_shape","x","batch-shape","x","q","`",",","where","negative","values","imply","feasibility",".","The","acquisition","function","will","compute","expected","feasible","hypervolume",".","X_pending",":","A","`","batch_shape","x","m","x","d","`","-dim","Tensor","of","`","m","`","design","points","that","have","points","that","have","been","submitted","for","function","evaluation","but","have","not","yet","been","evaluated",".","Concatenated","into","`","X","`","upon","forward","call",".","Copied","and","set","to","have","no","gradient",".","eta",":","The","temperature","parameter","for","the","sigmoid","function","used","for","the","differentiable","approximation","of","the","constraints",".","In","case","of","a","float","the","same","eta","is","used","for","every","constraint","in","constraints",".","In","case","of","a","tensor","the","length","of","the","tensor","must","match","the","number","of","provided","constraints",".","The","i-th","constraint","is","then","estimated","with","the","i-th","eta","value",".","fat",":","Toggles","the","logarithmic","\/","linear","asymptotic","behavior","of","the","smooth","approximation","to","the","ReLU","and","the","maximum",".","tau_relu",":","Temperature","parameter","controlling","the","sharpness","of","the","approximation","to","the","ReLU","over","the","`","q","`","candidate","points",".","For","further","details",",","see","the","comments","above","the","definition","of","`","TAU_RELU","`",".","tau_max",":","Temperature","parameter","controlling","the","sharpness","of","the","approximation","to","the","`","max","`","operator","over","the","`","q","`","candidate","points",".","For","further","details",",","see","the","comments","above","the","definition","of","`","TAU_MAX","`","."]
code: def __init__(
      self,
      model: Model,
      ref_point: Union[List[float], Tensor],
      partitioning: NondominatedPartitioning,
      sampler: Optional[MCSampler] = None,
      objective: Optional[MCMultiOutputObjective] = None,
      constraints: Optional[List[Callable[[Tensor], Tensor]]] = None,
      X_pending: Optional[Tensor] = None,
      eta: Optional[Union[Tensor, float]] = 1e-2,
      fat: bool = True,
      tau_relu: float = TAU_RELU,
      tau_max: float = TAU_MAX,
  ) -> None:
      r"""Parallel Log Expected Hypervolume Improvement supporting m>=2 outcomes.
  
      See [Ament2023logei]_ for details and the methodology behind the LogEI family of
      acquisition function. Line-by-line differences to the original differentiable
      expected hypervolume formulation of [Daulton2020qehvi]_ are described via inline
      comments in `forward`.
  
      Example:
          >>> model = SingleTaskGP(train_X, train_Y)
          >>> ref_point = [0.0, 0.0]
          >>> acq = qLogExpectedHypervolumeImprovement(model, ref_point, partitioning)
          >>> value = acq(test_X)
  
      Args:
          model: A fitted model.
          ref_point: A list or tensor with `m` elements representing the reference
              point (in the outcome space) w.r.t. to which compute the hypervolume.
              This is a reference point for the objective values (i.e. after
              applying`objective` to the samples).
          partitioning: A `NondominatedPartitioning` module that provides the non-
              dominated front and a partitioning of the non-dominated space in hyper-
              rectangles. If constraints are present, this partitioning must only
              include feasible points.
          sampler: The sampler used to draw base samples. If not given,
              a sampler is generated using `get_sampler`.
          objective: The MCMultiOutputObjective under which the samples are evaluated.
              Defaults to `IdentityMultiOutputObjective()`.
          constraints: A list of callables, each mapping a Tensor of dimension
              `sample_shape x batch-shape x q x m` to a Tensor of dimension
              `sample_shape x batch-shape x q`, where negative values imply
              feasibility. The acquisition function will compute expected feasible
              hypervolume.
          X_pending: A `batch_shape x m x d`-dim Tensor of `m` design points that have
              points that have been submitted for function evaluation but have not yet
              been evaluated. Concatenated into `X` upon forward call. Copied and set
              to have no gradient.
          eta: The temperature parameter for the sigmoid function used for the
              differentiable approximation of the constraints. In case of a float the
              same eta is used for every constraint in constraints. In case of a
              tensor the length of the tensor must match the number of provided
              constraints. The i-th constraint is then estimated with the i-th
              eta value.
          fat: Toggles the logarithmic / linear asymptotic behavior of the smooth
              approximation to the ReLU and the maximum.
          tau_relu: Temperature parameter controlling the sharpness of the
              approximation to the ReLU over the `q` candidate points. For further
              details, see the comments above the definition of `TAU_RELU`.
          tau_max: Temperature parameter controlling the sharpness of the
              approximation to the `max` operator over the `q` candidate points.
              For further details, see the comments above the definition of `TAU_MAX`.
      """
      if len(ref_point) != partitioning.num_outcomes:
          raise ValueError(
              "The dimensionality of the reference point must match the number of "
              f"outcomes. Got ref_point with {len(ref_point)} elements, but expected "
              f"{partitioning.num_outcomes}."
          )
      ref_point = torch.as_tensor(
          ref_point,
          dtype=partitioning.pareto_Y.dtype,
          device=partitioning.pareto_Y.device,
      )
      super().__init__(
          model=model,
          sampler=sampler,
          objective=objective,
          constraints=constraints,
          eta=eta,
          X_pending=X_pending,
      )
      self.register_buffer("ref_point", ref_point)
      cell_bounds = partitioning.get_hypercell_bounds()
      self.register_buffer("cell_lower_bounds", cell_bounds[0])
      self.register_buffer("cell_upper_bounds", cell_bounds[1])
      SubsetIndexCachingMixin.__init__(self)
      self.tau_relu = tau_relu
      self.tau_max = tau_max
      self.fat = fat
  
imports: from __future__ import annotations
  from typing import Callable, List, Optional, Tuple, Union
  import torch
  from botorch.acquisition.logei import TAU_MAX, TAU_RELU
  from botorch.acquisition.multi_objective import MultiObjectiveMCAcquisitionFunction
  from botorch.acquisition.multi_objective.objective import MCMultiOutputObjective
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.utils.multi_objective.box_decompositions.non_dominated import NondominatedPartitioning
  from botorch.utils.multi_objective.hypervolume import NoisyExpectedHypervolumeMixin, SubsetIndexCachingMixin
  from botorch.utils.objective import compute_smoothed_feasibility_indicator
  from botorch.utils.safe_math import fatmin, log_fatplus, log_softplus, logdiffexp, logmeanexp, logplusexp, logsumexp, smooth_amin
  from botorch.utils.transforms import concatenate_pending_points, is_ensemble, match_batch_shape, t_batch_mode_transform
  from torch import Tensor
label_desc: Use image node_id 1 to create a new qLogExpectedHypervolumeImprovement object from inherited base classes: MultiObjectiveMCAcquisitionFunction, SubsetIndexCachingMixin with example: obj = qLogExpectedHypervolumeImprovement(model, ref_point, partitioning, sampler, objective, constraints, X_pending, eta, fat, tau_relu, tau_max)