class_docstr: Abstract base class for acquisition functions based on Max-value Entropy Search.
  
  This class provides the basic building blocks for constructing max-value
  entropy-based acquisition functions along the lines of [Wang2017mves]_.
  
  Subclasses need to implement `_sample_max_values` and _compute_information_gain`
  methods.
  
  :meta private:
docstr: Compute max-value entropy at the design points `X`.
  
  Args:
      X: A `batch_shape x 1 x d`-dim Tensor of `batch_shape` t-batches
          with `1` `d`-dim design points each.
  
  Returns:
      A `batch_shape`-dim Tensor of MVE values at the given design points `X`.
docstr_tok: ["Compute","max-value","entropy","at","the","design","points","`","X","`",".","Args",":","X",":","A","`","batch_shape","x","1","x","d","`","-dim","Tensor","of","`","batch_shape","`","t-batches","with","`","1","`","`","d","`","-dim","design","points","each",".","Returns",":","A","`","batch_shape","`","-dim","Tensor","of","MVE","values","at","the","given","design","points","`","X","`","."]
code: def forward(self, X: Tensor) -> Tensor:
      r"""Compute max-value entropy at the design points `X`.
  
      Args:
          X: A `batch_shape x 1 x d`-dim Tensor of `batch_shape` t-batches
              with `1` `d`-dim design points each.
  
      Returns:
          A `batch_shape`-dim Tensor of MVE values at the given design points `X`.
      """
      # Compute the posterior, posterior mean, variance and std
      posterior = self.model.posterior(
          X.unsqueeze(-3),
          observation_noise=False,
          posterior_transform=self.posterior_transform,
      )
      # batch_shape x num_fantasies x (m) x 1
      mean = self.weight * posterior.mean.squeeze(-1).squeeze(-1)
      variance = posterior.variance.clamp_min(CLAMP_LB).view_as(mean)
      ig = self._compute_information_gain(
          X=X,
          mean_M=mean,
          variance_M=variance,
          covar_mM=variance.unsqueeze(-1),
      )
      return ig.mean(dim=0)
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from copy import deepcopy
  from math import log
  from typing import Any, Callable, Optional
  import numpy
  import torch
  from botorch.acquisition.acquisition import AcquisitionFunction, MCSamplerMixin
  from botorch.acquisition.cost_aware import CostAwareUtility, InverseCostWeightedUtility
  from botorch.acquisition.objective import PosteriorTransform
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.cost import AffineFidelityCostModel
  from botorch.models.model import Model
  from botorch.models.utils import check_no_nans
  from botorch.sampling.normal import SobolQMCNormalSampler
  from botorch.utils.transforms import match_batch_shape, t_batch_mode_transform
  from linear_operator.functions import inv_quad
  from linear_operator.utils.cholesky import psd_safe_cholesky
  from scipy.optimize import brentq
  from scipy.stats import norm
  from torch import Tensor
label_desc: Use image node_id 2 for calling the MaxValueBase obj's underlying member method code with example usage: obj.forward(X) and returns: ig