class_docstr: A model bridge for using torch-based models that fit on MapData. Most
  of the `TorchModelBridge` functionality is retained, except that this
  class should be used in the case where `model` makes use of map_key values.
  For example, the use case of fitting a joint surrogate model on
  `(parameters, map_key)`, while candidate generation is only for `parameters`.
class_docstr_tok: ["A","model","bridge","for","using","torch-based","models","that","fit","on","MapData",".","Most","of","the","`","TorchModelBridge","`","functionality","is","retained",",","except","that","this","class","should","be","used","in","the","case","where","`","model","`","makes","use","of","map_key","values",".","For","example",",","the","use","case","of","fitting","a","joint","surrogate","model","on","`","(","parameters",",","map_key",")","`",",","while","candidate","generation","is","only","for","`","parameters","`","."]
docstr: Make predictions at cv_test_points using only the data in obs_feats
  and obs_data. The difference from `TorchModelBridge._cross_validate`
  is that here we do cross validation on the parameters + map_keys. There
  is some extra logic to filter out out-of-design points in the map_key
  dimension.
docstr_tok: ["Make","predictions","at","cv_test_points","using","only","the","data","in","obs_feats","and","obs_data",".","The","difference","from","`","TorchModelBridge._cross_validate","`","is","that","here","we","do","cross","validation","on","the","parameters","+","map_keys",".","There","is","some","extra","logic","to","filter","out","out-of-design","points","in","the","map_key","dimension","."]
code: def _cross_validate(
      self,
      search_space: SearchSpace,
      cv_training_data: List[Observation],
      cv_test_points: List[ObservationFeatures],
      parameters: Optional[List[str]] = None,
      **kwargs: Any,
  ) -> List[ObservationData]:
      """Make predictions at cv_test_points using only the data in obs_feats
      and obs_data. The difference from `TorchModelBridge._cross_validate`
      is that here we do cross validation on the parameters + map_keys. There
      is some extra logic to filter out out-of-design points in the map_key
      dimension.
      """
      if parameters is None:
          parameters = self.parameters_with_map_keys
      cv_test_data = super()._cross_validate(
          search_space=search_space,
          cv_training_data=cv_training_data,
          cv_test_points=cv_test_points,
          parameters=parameters,  # we pass the map_keys too by default
          **kwargs,
      )
      observation_features, observation_data = separate_observations(
          cv_training_data
      )
      # Since map_keys are used as features, there can be the possibility that
      # models for different outcomes were fit on different ranges of map_key
      # values; for example, this is the case if we (1) mix learning curve data with
      # standard data (taking default map value), or (2) are in a situation where
      # some learning curves start later than others. These prediction results are
      # "out-of-design" in the map_key dimension, so we should filter them out.
      map_key_ranges = self._get_map_key_ranges(
          observation_features=observation_features,
          observation_data=observation_data,
      )
      cv_test_data = self._filter_outcomes_out_of_map_range(
          observation_features=cv_test_points,
          observation_data=cv_test_data,
          map_key_ranges=map_key_ranges,
      )
      return cv_test_data
  
imports: from typing import Any, Dict, List, Optional, Tuple, Type
  import numpy
  import torch
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.map_data import MapData
  from ax.core.observation import Observation, ObservationData, ObservationFeatures, observations_from_map_data, separate_observations
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.search_space import SearchSpace
  from ax.core.types import TCandidateMetadata
  from ax.modelbridge.base import GenResults
  from ax.modelbridge.modelbridge_utils import array_to_observation_data, observation_features_to_array, parse_observation_features
  from ax.modelbridge.torch import FIT_MODEL_ERROR, TorchModelBridge
  from ax.modelbridge.transforms.base import Transform
  from ax.models.torch_base import TorchModel
  from ax.models.types import TConfig
  from ax.utils.common.constants import Keys
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 9 for calling the MapTorchModelBridge obj's underlying member method code with example usage: obj._cross_validate(search_space, cv_training_data, cv_test_points, parameters) and returns: cv_test_data