class_docstr: Abstract base class for Monte-Carlo-based batch LogEI acquisition functions.
  
  :meta private:
class_docstr_tok: ["Abstract","base","class","for","Monte-Carlo-based","batch","LogEI","acquisition","functions",".",":","meta","private",":"]
docstr: Args:
      model: A fitted model.
      sampler: The sampler used to draw base samples. If not given,
          a sampler is generated using `get_sampler`.
          NOTE: For posteriors that do not support base samples,
          a sampler compatible with intended use case must be provided.
          See `ForkedRNGSampler` and `StochasticSampler` as examples.
      objective: The MCAcquisitionObjective under which the samples are
          evaluated. Defaults to `IdentityMCObjective()`.
      posterior_transform: A PosteriorTransform (optional).
      X_pending: A `batch_shape, 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.
      constraints: A list of constraint callables which map a Tensor of posterior
          samples of dimension `sample_shape x batch-shape x q x m`-dim to a
          `sample_shape x batch-shape x q`-dim Tensor. The associated constraints
          are satisfied if `constraint(samples) < 0`.
      eta: Temperature parameter(s) governing the smoothness of the sigmoid
          approximation to the constraint indicators. See the docs of
          `compute_(log_)constraint_indicator` for more details on this parameter.
      fat: Toggles the logarithmic / linear asymptotic behavior of the smooth
          approximation to the ReLU.
      tau_max: Temperature parameter controlling the sharpness of the
          approximation to the `max` operator over the `q` candidate points.
docstr_tok: ["Args",":","model",":","A","fitted","model",".","sampler",":","The","sampler","used","to","draw","base","samples",".","If","not","given",",","a","sampler","is","generated","using","`","get_sampler","`",".","NOTE",":","For","posteriors","that","do","not","support","base","samples",",","a","sampler","compatible","with","intended","use","case","must","be","provided",".","See","`","ForkedRNGSampler","`","and","`","StochasticSampler","`","as","examples",".","objective",":","The","MCAcquisitionObjective","under","which","the","samples","are","evaluated",".","Defaults","to","`","IdentityMCObjective","(",")","`",".","posterior_transform",":","A","PosteriorTransform","(","optional",")",".","X_pending",":","A","`","batch_shape",",","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",".","constraints",":","A","list","of","constraint","callables","which","map","a","Tensor","of","posterior","samples","of","dimension","`","sample_shape","x","batch-shape","x","q","x","m","`","-dim","to","a","`","sample_shape","x","batch-shape","x","q","`","-dim","Tensor",".","The","associated","constraints","are","satisfied","if","`","constraint","(","samples",")","<","0","`",".","eta",":","Temperature","parameter","(","s",")","governing","the","smoothness","of","the","sigmoid","approximation","to","the","constraint","indicators",".","See","the","docs","of","`","compute_","(","log_",")","constraint_indicator","`","for","more","details","on","this","parameter",".","fat",":","Toggles","the","logarithmic","\/","linear","asymptotic","behavior","of","the","smooth","approximation","to","the","ReLU",".","tau_max",":","Temperature","parameter","controlling","the","sharpness","of","the","approximation","to","the","`","max","`","operator","over","the","`","q","`","candidate","points","."]
code: def __init__(
      self,
      model: Model,
      sampler: Optional[MCSampler] = None,
      objective: Optional[MCAcquisitionObjective] = None,
      posterior_transform: Optional[PosteriorTransform] = None,
      X_pending: Optional[Tensor] = None,
      constraints: Optional[List[Callable[[Tensor], Tensor]]] = None,
      eta: Union[Tensor, float] = 1e-3,
      fat: bool = True,
      tau_max: float = TAU_MAX,
  ) -> None:
      r"""
      Args:
          model: A fitted model.
          sampler: The sampler used to draw base samples. If not given,
              a sampler is generated using `get_sampler`.
              NOTE: For posteriors that do not support base samples,
              a sampler compatible with intended use case must be provided.
              See `ForkedRNGSampler` and `StochasticSampler` as examples.
          objective: The MCAcquisitionObjective under which the samples are
              evaluated. Defaults to `IdentityMCObjective()`.
          posterior_transform: A PosteriorTransform (optional).
          X_pending: A `batch_shape, 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.
          constraints: A list of constraint callables which map a Tensor of posterior
              samples of dimension `sample_shape x batch-shape x q x m`-dim to a
              `sample_shape x batch-shape x q`-dim Tensor. The associated constraints
              are satisfied if `constraint(samples) < 0`.
          eta: Temperature parameter(s) governing the smoothness of the sigmoid
              approximation to the constraint indicators. See the docs of
              `compute_(log_)constraint_indicator` for more details on this parameter.
          fat: Toggles the logarithmic / linear asymptotic behavior of the smooth
              approximation to the ReLU.
          tau_max: Temperature parameter controlling the sharpness of the
              approximation to the `max` operator over the `q` candidate points.
      """
      if isinstance(objective, ConstrainedMCObjective):
          raise BotorchError(
              "Log-Improvement should not be used with `ConstrainedMCObjective`."
              "Please pass the `constraints` directly to the constructor of the "
              "acquisition function."
          )
      q_reduction = partial(fatmax if fat else smooth_amax, tau=tau_max)
      super().__init__(
          model=model,
          sampler=sampler,
          objective=objective,
          posterior_transform=posterior_transform,
          X_pending=X_pending,
          sample_reduction=logmeanexp,
          q_reduction=q_reduction,
          constraints=constraints,
          eta=eta,
          fat=fat,
      )
      self.tau_max = tau_max
  
imports: from __future__ import annotations
  from copy import deepcopy
  from functools import partial
  from typing import Any, Callable, List, Optional, Tuple, TypeVar, Union
  import torch
  from botorch.acquisition.cached_cholesky import CachedCholeskyMCSamplerMixin
  from botorch.acquisition.monte_carlo import SampleReducingMCAcquisitionFunction
  from botorch.acquisition.objective import ConstrainedMCObjective, MCAcquisitionObjective, PosteriorTransform
  from botorch.acquisition.utils import compute_best_feasible_objective, prune_inferior_points
  from botorch.exceptions.errors import BotorchError
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.utils.safe_math import fatmax, log_fatplus, log_softplus, logmeanexp, smooth_amax
  from botorch.utils.transforms import match_batch_shape
  from torch import Tensor
label_desc: Use image node_id 1 to create a new LogImprovementMCAcquisitionFunction object from inherited base classes: SampleReducingMCAcquisitionFunction with example: obj = LogImprovementMCAcquisitionFunction(model, sampler, objective, posterior_transform, X_pending, constraints, eta, fat, tau_max)