class_docstr: MC Bayesian Active Learning by Disagreement
class_docstr_tok: ["MC","Bayesian","Active","Learning","by","Disagreement"]
docstr: Monte Carlo implementation of Bayesian Active Learning by Disagreement (BALD)
  proposed in [Houlsby2011bald]_.
  
  Args:
      pref_model: The preference model that maps the outcomes (i.e., Y) to
          scalar-valued utility.
      outcome_model: A deterministic model that maps parameters (i.e., X) to
          outcomes (i.e., Y). The outcome model f defines the search space of
          Y = f(X). If model is None, we are directly calculating BALD on
          the parameter space.
      num_samples: number of samples to approximate the conditional_entropy.
      std_noise: Additional observational noise to include. Defaults to 0.
docstr_tok: ["Monte","Carlo","implementation","of","Bayesian","Active","Learning","by","Disagreement","(","BALD",")","proposed","in","[","Houlsby2011bald","]","_.","Args",":","pref_model",":","The","preference","model","that","maps","the","outcomes","(","i.e.",",","Y",")","to","scalar-valued","utility",".","outcome_model",":","A","deterministic","model","that","maps","parameters","(","i.e.",",","X",")","to","outcomes","(","i.e.",",","Y",")",".","The","outcome","model","f","defines","the","search","space","of","Y","=","f","(","X",")",".","If","model","is","None",",","we","are","directly","calculating","BALD","on","the","parameter","space",".","num_samples",":","number","of","samples","to","approximate","the","conditional_entropy",".","std_noise",":","Additional","observational","noise","to","include",".","Defaults","to","0","."]
code: def __init__(
      self,
      pref_model: Model,
      outcome_model: Optional[DeterministicModel] = None,
      num_samples: Optional[int] = 1024,
      std_noise: Optional[float] = 0.0,
      **kwargs: Any,
  ) -> None:
      """
      Monte Carlo implementation of Bayesian Active Learning by Disagreement (BALD)
      proposed in [Houlsby2011bald]_.
  
      Args:
          pref_model: The preference model that maps the outcomes (i.e., Y) to
              scalar-valued utility.
          outcome_model: A deterministic model that maps parameters (i.e., X) to
              outcomes (i.e., Y). The outcome model f defines the search space of
              Y = f(X). If model is None, we are directly calculating BALD on
              the parameter space.
          num_samples: number of samples to approximate the conditional_entropy.
          std_noise: Additional observational noise to include. Defaults to 0.
      """
      super().__init__(model=pref_model)
      # ensure the model is in eval mode
      self.add_module("outcome_model", outcome_model)
  
      self.num_samples = num_samples
      # assuming the relative observation noise is fixed at 1.0 (e.g., in PairwiseGP)
      self.std_noise = std_noise
      self.std_normal = Normal(0, 1)
  
file_path: botorch/botorch/acquisition/preference.py
imports: from __future__ import annotations
  from typing import Any, Optional
  import torch
  from botorch.acquisition import AnalyticAcquisitionFunction
  from botorch.acquisition.monte_carlo import MCAcquisitionFunction
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.deterministic import DeterministicModel
  from botorch.models.model import Model
  from botorch.utils.transforms import match_batch_shape, t_batch_mode_transform
  from torch import Tensor
  from torch.distributions import Bernoulli, Normal
label_desc: Use image node_id 1 to create a new PairwiseBayesianActiveLearningByDisagreement object from inherited base classes: MCAcquisitionFunction with example: obj = PairwiseBayesianActiveLearningByDisagreement(pref_model, outcome_model, num_samples, std_noise)