class_docstr: MC-based batch Simple Regret.
  
  Samples from the joint posterior over the q-batch and computes the simple regret.
  
  `qSR(X) = E(max Y), Y ~ f(X), X = (x_1,...,x_q)`
  
  Constraints should be provided as a `ConstrainedMCObjective`.
  Passing `constraints` as an argument is not supported. This is because
  `SampleReducingMCAcquisitionFunction` computes the acquisition values on the sample
  level and then weights the sample-level acquisition values by a soft feasibility
  indicator. Hence, it expects non-log acquisition function values to be
  non-negative. `qSimpleRegret` acquisition values can be negative, so we instead use
  a `ConstrainedMCObjective` which applies constraints to the objectives (e.g. before
  computing the acquisition function) and shifts negative objective values using
  by an infeasible cost to ensure non-negativity (before applying constraints and
  shifting them back).
  
  Example:
      >>> model = SingleTaskGP(train_X, train_Y)
      >>> sampler = SobolQMCNormalSampler(1024)
      >>> qSR = qSimpleRegret(model, sampler)
      >>> qsr = qSR(test_X)
class_docstr_tok: ["MC-based","batch","Simple","Regret",".","Samples","from","the","joint","posterior","over","the","q-batch","and","computes","the","simple","regret",".","`","qSR","(","X",")","=","E","(","max","Y",")",",","Y","~","f","(","X",")",",","X","=","(","x_1",",","...",",","x_q",")","`","Constraints","should","be","provided","as","a","`","ConstrainedMCObjective","`",".","Passing","`","constraints","`","as","an","argument","is","not","supported",".","This","is","because","`","SampleReducingMCAcquisitionFunction","`","computes","the","acquisition","values","on","the","sample","level","and","then","weights","the","sample-level","acquisition","values","by","a","soft","feasibility","indicator",".","Hence",",","it","expects","non-log","acquisition","function","values","to","be","non-negative",".","`","qSimpleRegret","`","acquisition","values","can","be","negative",",","so","we","instead","use","a","`","ConstrainedMCObjective","`","which","applies","constraints","to","the","objectives","(","e.g",".","before","computing","the","acquisition","function",")","and","shifts","negative","objective","values","using","by","an","infeasible","cost","to","ensure","non-negativity","(","before","applying","constraints","and","shifting","them","back",")",".","Example",":",">",">",">","model","=","SingleTaskGP","(","train_X",",","train_Y",")",">",">",">","sampler","=","SobolQMCNormalSampler","(","1024",")",">",">",">","qSR","=","qSimpleRegret","(","model",",","sampler",")",">",">",">","qsr","=","qSR","(","test_X",")"]
docstr: q-Simple Regret.
  
  Args:
      model: A fitted model.
      sampler: The sampler used to draw base samples. See `MCAcquisitionFunction`
          more details.
      objective: The MCAcquisitionObjective under which the samples are
          evaluated. Defaults to `IdentityMCObjective()`.
      posterior_transform: A PosteriorTransform (optional).
      X_pending:  A `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.
docstr_tok: ["q-Simple","Regret",".","Args",":","model",":","A","fitted","model",".","sampler",":","The","sampler","used","to","draw","base","samples",".","See","`","MCAcquisitionFunction","`","more","details",".","objective",":","The","MCAcquisitionObjective","under","which","the","samples","are","evaluated",".","Defaults","to","`","IdentityMCObjective","(",")","`",".","posterior_transform",":","A","PosteriorTransform","(","optional",")",".","X_pending",":","A","`","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","."]
code: def __init__(
      self,
      model: Model,
      sampler: Optional[MCSampler] = None,
      objective: Optional[MCAcquisitionObjective] = None,
      posterior_transform: Optional[PosteriorTransform] = None,
      X_pending: Optional[Tensor] = None,
  ) -> None:
      r"""q-Simple Regret.
  
      Args:
          model: A fitted model.
          sampler: The sampler used to draw base samples. See `MCAcquisitionFunction`
              more details.
          objective: The MCAcquisitionObjective under which the samples are
              evaluated. Defaults to `IdentityMCObjective()`.
          posterior_transform: A PosteriorTransform (optional).
          X_pending:  A `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.
      """
      super().__init__(
          model=model,
          sampler=sampler,
          objective=objective,
          posterior_transform=posterior_transform,
          X_pending=X_pending,
      )
  
imports: from __future__ import annotations
  import math
  from abc import ABC, abstractmethod
  from copy import deepcopy
  from functools import partial
  from typing import Callable, List, Optional, Protocol, Tuple, Union
  import torch
  from botorch.acquisition.acquisition import AcquisitionFunction, MCSamplerMixin
  from botorch.acquisition.cached_cholesky import CachedCholeskyMCSamplerMixin
  from botorch.acquisition.objective import ConstrainedMCObjective, IdentityMCObjective, MCAcquisitionObjective, PosteriorTransform
  from botorch.acquisition.utils import compute_best_feasible_objective, prune_inferior_points, repeat_to_match_aug_dim
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.utils.objective import compute_smoothed_feasibility_indicator
  from botorch.utils.transforms import concatenate_pending_points, match_batch_shape, t_batch_mode_transform
  from torch import Tensor
label_desc: Use image node_id 1 to create a new qSimpleRegret object from inherited base classes: SampleReducingMCAcquisitionFunction with example: obj = qSimpleRegret(model, sampler, objective, posterior_transform, X_pending)