class_docstr: The Knowledge Gradient with one shot optimization.
  
  Args:
      cost_intercept: The cost intercept for the affine cost of the form
          `cost_intercept + n`, where `n` is the number of generated points.
          Only used for multi-fidelity optimzation (i.e., if fidelity_features
          are present).
      linear_truncated: If `False`, use an alternate downsampling + exponential
          decay Kernel instead of the default `LinearTruncatedFidelityKernel`
          (only relevant for multi-fidelity optimization).
      kwargs: Model-specific kwargs.
class_docstr_tok: ["The","Knowledge","Gradient","with","one","shot","optimization",".","Args",":","cost_intercept",":","The","cost","intercept","for","the","affine","cost","of","the","form","`","cost_intercept","+","n","`",",","where","`","n","`","is","the","number","of","generated","points",".","Only","used","for","multi-fidelity","optimzation","(","i.e.",",","if","fidelity_features","are","present",")",".","linear_truncated",":","If","`","False","`",",","use","an","alternate","downsampling","+","exponential","decay","Kernel","instead","of","the","default","`","LinearTruncatedFidelityKernel","`","(","only","relevant","for","multi-fidelity","optimization",")",".","kwargs",":","Model-specific","kwargs","."]
code: def __init__(
      self,
      cost_intercept: float = 1.0,
      linear_truncated: bool = True,
      use_input_warping: bool = False,
      **kwargs: Any,
  ) -> None:
      super().__init__(
          best_point_recommender=recommend_best_out_of_sample_point,
          linear_truncated=linear_truncated,
          use_input_warping=use_input_warping,
          **kwargs,
      )
      self.cost_intercept = cost_intercept
  
imports: import dataclasses
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.models.torch.botorch import BotorchModel, get_rounding_func
  from ax.models.torch.botorch_defaults import recommend_best_out_of_sample_point
  from ax.models.torch.utils import _get_X_pending_and_observed, _to_inequality_constraints, get_botorch_objective_and_transform, get_out_of_sample_best_point_acqf, subset_model
  from ax.models.torch_base import TorchGenResults, TorchOptConfig
  from ax.utils.common.typeutils import not_none
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.cost_aware import InverseCostWeightedUtility
  from botorch.acquisition.knowledge_gradient import qKnowledgeGradient, qMultiFidelityKnowledgeGradient
  from botorch.acquisition.objective import MCAcquisitionObjective, PosteriorTransform
  from botorch.acquisition.utils import expand_trace_observations, project_to_target_fidelity
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.cost import AffineFidelityCostModel
  from botorch.models.model import Model
  from botorch.optim.initializers import gen_one_shot_kg_initial_conditions
  from botorch.optim.optimize import optimize_acqf
  from botorch.sampling.normal import IIDNormalSampler, SobolQMCNormalSampler
  from torch import Tensor
label_desc: Use image node_id 1 to create a new KnowledgeGradient object from inherited base classes: BotorchModel with example: obj = KnowledgeGradient(cost_intercept, linear_truncated, use_input_warping)