class_docstr: A wrapper around AcquisitionFunctions to add proximal weighting of the
  acquisition function. The acquisition function is
  weighted via a squared exponential centered at the last training point,
  with varying lengthscales corresponding to `proximal_weights`. Can only be used
  with acquisition functions based on single batch models. Acquisition functions
  must be positive or `beta` must be specified to apply a SoftPlus transform before
  proximal weighting.
  
  Small values of `proximal_weights` corresponds to strong biasing towards recently
  observed points, which smoothes optimization with a small potential decrese in
  convergence rate.
  
  
  
  Example:
      >>> model = SingleTaskGP(train_X, train_Y)
      >>> EI = ExpectedImprovement(model, best_f=0.0)
      >>> proximal_weights = torch.ones(d)
      >>> EI_proximal = ProximalAcquisitionFunction(EI, proximal_weights)
      >>> eip = EI_proximal(test_X)
class_docstr_tok: ["A","wrapper","around","AcquisitionFunctions","to","add","proximal","weighting","of","the","acquisition","function",".","The","acquisition","function","is","weighted","via","a","squared","exponential","centered","at","the","last","training","point",",","with","varying","lengthscales","corresponding","to","`","proximal_weights","`",".","Can","only","be","used","with","acquisition","functions","based","on","single","batch","models",".","Acquisition","functions","must","be","positive","or","`","beta","`","must","be","specified","to","apply","a","SoftPlus","transform","before","proximal","weighting",".","Small","values","of","`","proximal_weights","`","corresponds","to","strong","biasing","towards","recently","observed","points",",","which","smoothes","optimization","with","a","small","potential","decrese","in","convergence","rate",".","Example",":",">",">",">","model","=","SingleTaskGP","(","train_X",",","train_Y",")",">",">",">","EI","=","ExpectedImprovement","(","model",",","best_f=0.0",")",">",">",">","proximal_weights","=","torch.ones","(","d",")",">",">",">","EI_proximal","=","ProximalAcquisitionFunction","(","EI",",","proximal_weights",")",">",">",">","eip","=","EI_proximal","(","test_X",")"]
docstr: Derived Acquisition Function weighted by proximity to recently
  observed point.
  
  Args:
      acq_function: The base acquisition function, operating on input tensors
          of feature dimension `d`.
      proximal_weights: A `d` dim tensor used to bias locality
          along each axis.
      transformed_weighting: If True, the proximal weights are applied in
          the transformed input space given by
          `acq_function.model.input_transform` (if available), otherwise
          proximal weights are applied in real input space.
      beta: If not None, apply a softplus transform to the base acquisition
          function, allows negative base acquisition function values.
docstr_tok: ["Derived","Acquisition","Function","weighted","by","proximity","to","recently","observed","point",".","Args",":","acq_function",":","The","base","acquisition","function",",","operating","on","input","tensors","of","feature","dimension","`","d","`",".","proximal_weights",":","A","`","d","`","dim","tensor","used","to","bias","locality","along","each","axis",".","transformed_weighting",":","If","True",",","the","proximal","weights","are","applied","in","the","transformed","input","space","given","by","`","acq_function.model.input_transform","`","(","if","available",")",",","otherwise","proximal","weights","are","applied","in","real","input","space",".","beta",":","If","not","None",",","apply","a","softplus","transform","to","the","base","acquisition","function",",","allows","negative","base","acquisition","function","values","."]
code: def __init__(
      self,
      acq_function: AcquisitionFunction,
      proximal_weights: Tensor,
      transformed_weighting: Optional[bool] = True,
      beta: Optional[float] = None,
  ) -> None:
      r"""Derived Acquisition Function weighted by proximity to recently
      observed point.
  
      Args:
          acq_function: The base acquisition function, operating on input tensors
              of feature dimension `d`.
          proximal_weights: A `d` dim tensor used to bias locality
              along each axis.
          transformed_weighting: If True, the proximal weights are applied in
              the transformed input space given by
              `acq_function.model.input_transform` (if available), otherwise
              proximal weights are applied in real input space.
          beta: If not None, apply a softplus transform to the base acquisition
              function, allows negative base acquisition function values.
      """
      Module.__init__(self)
  
      self.acq_func = acq_function
      model = self.acq_func.model
  
      if hasattr(acq_function, "X_pending"):
          if acq_function.X_pending is not None:
              raise UnsupportedError(
                  "Proximal acquisition function requires `X_pending` to be None."
              )
          self.X_pending = acq_function.X_pending
  
      self.register_buffer("proximal_weights", proximal_weights)
      self.register_buffer(
          "transformed_weighting", torch.tensor(transformed_weighting)
      )
  
      self.register_buffer(
          "beta", None if beta is None else torch.tensor(beta)
      )
  
      _validate_model(model, proximal_weights)
  
file_path: botorch/botorch/acquisition/proximal.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from botorch.acquisition import AcquisitionFunction
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models import ModelListGP
  from botorch.models.gpytorch import BatchedMultiOutputGPyTorchModel
  from botorch.models.model import Model
  from botorch.models.transforms.input import InputTransform
  from botorch.utils import t_batch_mode_transform
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 1 to create a new ProximalAcquisitionFunction object from inherited base classes: AcquisitionFunction with example: obj = ProximalAcquisitionFunction(acq_function, proximal_weights, transformed_weighting, beta)