class_docstr: The acquisition function for MESMO.
  
  This acquisition function computes the mutual information of
  Pareto frontier and a candidate point. See [Belakaria2019]_ for
  a detailed discussion.
  
  q > 1 is supported through cyclic optimization and fantasies.
  
  Noisy observations are support by computing information gain with
  observation noise as in Appendix C in [Takeno2020mfmves]_.
  
  Note: this only supports maximization.
  
  Attributes:
      _default_sample_shape: The `sample_shape` for the default sampler.
  
  Example:
      >>> model = SingleTaskGP(train_X, train_Y)
      >>> MESMO = qMultiObjectiveMaxValueEntropy(model, sample_pfs)
      >>> mesmo = MESMO(test_X)
class_docstr_tok: ["The","acquisition","function","for","MESMO",".","This","acquisition","function","computes","the","mutual","information","of","Pareto","frontier","and","a","candidate","point",".","See","[","Belakaria2019","]","_","for","a","detailed","discussion",".","q",">","1","is","supported","through","cyclic","optimization","and","fantasies",".","Noisy","observations","are","support","by","computing","information","gain","with","observation","noise","as","in","Appendix","C","in","[","Takeno2020mfmves","]","_",".","Note",":","this","only","supports","maximization",".","Attributes",":","_default_sample_shape",":","The","`","sample_shape","`","for","the","default","sampler",".","Example",":",">",">",">","model","=","SingleTaskGP","(","train_X",",","train_Y",")",">",">",">","MESMO","=","qMultiObjectiveMaxValueEntropy","(","model",",","sample_pfs",")",">",">",">","mesmo","=","MESMO","(","test_X",")"]
docstr: Multi-objective max-value entropy search acquisition function.
  
  Args:
      model: A fitted multi-output model.
      sample_pareto_frontiers: A callable that takes a model and returns a
          `num_samples x n' x m`-dim tensor of outcomes to use for constructing
          `num_samples` sampled Pareto frontiers.
      num_fantasies: Number of fantasies to generate. The higher this
          number the more accurate the model (at the expense of model
          complexity, wall time and memory). Ignored if `X_pending` is `None`.
      X_pending: A `m x d`-dim Tensor of `m` design points that have been
          submitted for function evaluation, but have not yet been evaluated.
docstr_tok: ["Multi-objective","max-value","entropy","search","acquisition","function",".","Args",":","model",":","A","fitted","multi-output","model",".","sample_pareto_frontiers",":","A","callable","that","takes","a","model","and","returns","a","`","num_samples","x","n","'","x","m","`","-dim","tensor","of","outcomes","to","use","for","constructing","`","num_samples","`","sampled","Pareto","frontiers",".","num_fantasies",":","Number","of","fantasies","to","generate",".","The","higher","this","number","the","more","accurate","the","model","(","at","the","expense","of","model","complexity",",","wall","time","and","memory",")",".","Ignored","if","`","X_pending","`","is","`","None","`",".","X_pending",":","A","`","m","x","d","`","-dim","Tensor","of","`","m","`","design","points","that","have","been","submitted","for","function","evaluation",",","but","have","not","yet","been","evaluated","."]
code: def __init__(
      self,
      model: Model,
      sample_pareto_frontiers: Callable[[Model], Tensor],
      num_fantasies: int = 16,
      X_pending: Optional[Tensor] = None,
      sampler: Optional[MCSampler] = None,
      **kwargs: Any,
  ) -> None:
      r"""Multi-objective max-value entropy search acquisition function.
  
      Args:
          model: A fitted multi-output model.
          sample_pareto_frontiers: A callable that takes a model and returns a
              `num_samples x n' x m`-dim tensor of outcomes to use for constructing
              `num_samples` sampled Pareto frontiers.
          num_fantasies: Number of fantasies to generate. The higher this
              number the more accurate the model (at the expense of model
              complexity, wall time and memory). Ignored if `X_pending` is `None`.
          X_pending: A `m x d`-dim Tensor of `m` design points that have been
              submitted for function evaluation, but have not yet been evaluated.
      """
      MultiObjectiveMCAcquisitionFunction.__init__(
          self, model=model, sampler=sampler
      )
  
      # Batch GP models (e.g. fantasized models) are not currently supported
      if isinstance(model, ModelListGP):
          train_X = model.models[0].train_inputs[0]
      else:
          train_X = model.train_inputs[0]
      if train_X.ndim > 3:
          raise NotImplementedError(
              "Batch GP models (e.g. fantasized models) "
              "are not yet supported by qMultiObjectiveMaxValueEntropy"
          )
      # convert to batched MO model
      batched_mo_model = (
          model_list_to_batched(model)
          if isinstance(model, ModelListGP)
          else model
      )
      self._init_model = batched_mo_model
      self.mo_model = batched_mo_model
      self.model = batched_multi_output_to_single_output(
          batch_mo_model=batched_mo_model
      )
      self.fantasies_sampler = SobolQMCNormalSampler(
          sample_shape=torch.Size([num_fantasies])
      )
      self.num_fantasies = num_fantasies
      # weight is used in _compute_information_gain
      self.maximize = True
      self.weight = 1.0
      self.sample_pareto_frontiers = sample_pareto_frontiers
  
      # this avoids unnecessary model conversion if X_pending is None
      if X_pending is None:
          self._sample_max_values()
      else:
          self.set_X_pending(X_pending)
      # This avoids attribute errors in qMaxValueEntropy code.
      self.posterior_transform = None
  
imports: from __future__ import annotations
  from math import pi
  from typing import Any, Callable, Optional, Tuple, Union
  import torch
  from botorch.acquisition.max_value_entropy_search import qMaxValueEntropy
  from botorch.acquisition.multi_objective.joint_entropy_search import LowerBoundMultiObjectiveEntropySearch
  from botorch.acquisition.multi_objective.monte_carlo import MultiObjectiveMCAcquisitionFunction
  from botorch.models.converter import batched_multi_output_to_single_output, model_list_to_batched
  from botorch.models.model import Model
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from botorch.sampling.base import MCSampler
  from botorch.sampling.normal import SobolQMCNormalSampler
  from botorch.utils.transforms import concatenate_pending_points, t_batch_mode_transform
  from torch import Tensor
label_desc: Use image node_id 1 to create a new qMultiObjectiveMaxValueEntropy object from inherited base classes: qMaxValueEntropy, MultiObjectiveMCAcquisitionFunction with example: obj = qMultiObjectiveMaxValueEntropy(model, sample_pareto_frontiers, num_fantasies, X_pending, sampler)