code: def config_to_nested(config):
      """Convert config to nested version"""
      estimator = config.get("estimator", None)
      transfer = config.get("transfer", None)
      # choose hyperparameters based on pretrained model in transfer learning
      if transfer:
          # choose estimator
          if transfer.startswith("ssd"):
              estimator = SSDEstimator
          elif transfer.startswith("yolo3"):
              estimator = YOLOv3Estimator
          elif transfer.startswith("faster_rcnn"):
              estimator = FasterRCNNEstimator
          elif transfer.startswith("center_net"):
              estimator = CenterNetEstimator
          else:
              estimator = ImageClassificationEstimator
          # choose base network
          transfer_list = transfer.split("_")
          if transfer_list[0] == "ssd":
              transfer_list.pop(0)
              config["data_shape"] = int(transfer_list.pop(0))
              transfer_list.pop(-1)
          elif transfer_list[0] == "yolo3":
              transfer_list.pop(0)
              transfer_list.pop(-1)
          else:
              transfer_list.pop(0)
              transfer_list.pop(0)
              transfer_list.pop(-1)
          config["base_network"] = "_".join(transfer_list)
          if config["base_network"].startswith("mobilenet"):
              config["base_network"].replace("_", ".")
      elif isinstance(estimator, str):
          if estimator == "ssd":
              estimator = SSDEstimator
          elif estimator == "yolo3":
              estimator = YOLOv3Estimator
          elif estimator == "faster_rcnn":
              estimator = FasterRCNNEstimator
          elif estimator == "center_net":
              estimator = CenterNetEstimator
          elif estimator == "img_cls":
              estimator = ImageClassificationEstimator
          else:
              raise ValueError(f"Unknown estimator: {estimator}")
      else:
          assert issubclass(estimator, BaseEstimator)
  
      cfg_map = estimator._default_cfg.asdict()
  
      def _recursive_update(config, key, value, auto_strs, auto_ints):
          for k, v in config.items():
              if k in auto_strs:
                  config[k] = "auto"
              if k in auto_ints:
                  config[k] = -1
              if key == k:
                  config[key] = value
              elif isinstance(v, dict):
                  _recursive_update(v, key, value, auto_strs, auto_ints)
  
      if "use_rec" in config:
          auto_strs = ["data_dir"]
          auto_ints = []
      else:
          auto_strs = [
              "data_dir",
              "rec_train",
              "rec_train_idx",
              "rec_val",
              "rec_val_idx",
              "dataset",
              "dataset_root",
          ]
          auto_ints = ["num_training_samples"]
      for k, v in config.items():
          _recursive_update(cfg_map, k, v, auto_strs, auto_ints)
      cfg_map["estimator"] = estimator
      return cfg_map
  
imports: import copy
  import warnings
  import numpy
  import autogluon.core
  from ..estimators.base_estimator import BaseEstimator
  from ..estimators import SSDEstimator, FasterRCNNEstimator, YOLOv3Estimator, CenterNetEstimator
  from ..estimators import ImageClassificationEstimator
  from ..data.dataset import ObjectDetectionDataset
label_desc: Use image node_id 3 for calling a global function with example usage: config_to_nested(config) and returns: cfg_map