class_docstr: Multi-fidelity max-value entropy.
  
  The acquisition function for multi-fidelity max-value entropy search
  with support for trace observations. See [Takeno2020mfmves]_
  for a detailed discussion of the basic ideas on multi-fidelity MES
  (note that this implementation is somewhat different).
  
  The model must be single-outcome, unless using a PosteriorTransform.
  The batch case `q > 1` is supported through cyclic optimization and fantasies.
  
  Example:
      >>> model = SingleTaskGP(train_X, train_Y)
      >>> candidate_set = torch.rand(1000, bounds.size(1))
      >>> candidate_set = bounds[0] + (bounds[1] - bounds[0]) * candidate_set
      >>> MF_MES = qMultiFidelityMaxValueEntropy(model, candidate_set)
      >>> mf_mes = MF_MES(test_X)
docstr: Evaluates `qMultifidelityMaxValueEntropy` 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 point each.
  
  Returns:
      A `batch_shape`-dim Tensor of MF-MVES values at the design points `X`.
docstr_tok: ["Evaluates","`","qMultifidelityMaxValueEntropy","`","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","point","each",".","Returns",":","A","`","batch_shape","`","-dim","Tensor","of","MF-MVES","values","at","the","design","points","`","X","`","."]
code: def forward(self, X: Tensor) -> Tensor:
      r"""Evaluates `qMultifidelityMaxValueEntropy` 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 point each.
  
      Returns:
          A `batch_shape`-dim Tensor of MF-MVES values at the design points `X`.
      """
      X_expand = self.expand(
          X
      )  # batch_shape x (1 + num_trace_observations) x d
      X_max_fidelity = self.project(X)  # batch_shape x 1 x d
      X_all = torch.cat((X_expand, X_max_fidelity), dim=-2).unsqueeze(
          -3
      )
      # batch_shape x num_fantasies x (2 + num_trace_observations) x d
  
      # Compute the posterior, posterior mean, variance without noise
      # `_m` and `_M` in the var names means the current and the max fidelity.
      posterior = self.model.posterior(
          X_all,
          observation_noise=False,
          posterior_transform=self.posterior_transform,
      )
      mean_M = (
          self.weight * posterior.mean[..., -1, 0]
      )  # batch_shape x num_fantasies
      variance_M = posterior.variance[..., -1, 0].clamp_min(CLAMP_LB)
      # get the covariance between the low fidelities and max fidelity
      covar_mM = posterior.distribution.covariance_matrix[..., :-1, -1]
      # batch_shape x num_fantasies x (1 + num_trace_observations)
  
      check_no_nans(mean_M)
      check_no_nans(variance_M)
      check_no_nans(covar_mM)
  
      # compute the information gain (IG)
      ig = self._compute_information_gain(
          X=X_expand,
          mean_M=mean_M,
          variance_M=variance_M,
          covar_mM=covar_mM,
      )
      ig = self.cost_aware_utility(
          X=X, deltas=ig, sampler=self.cost_sampler
      )
      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 3 for calling the qMultiFidelityMaxValueEntropy obj's underlying member method code with example usage: obj.forward(X) and returns: ig