code: def get_config(cfg):
      """
      Sets the hyper-parameters for the optimizer and experiment using the config file
  
      Args:
          cfg: A YACS config object.
      """
      config_params = {
          "train_params": {
              "adapt_lambda": cfg.SOLVER.AD_LAMBDA,
              "adapt_lr": cfg.SOLVER.AD_LR,
              "lambda_init": cfg.SOLVER.INIT_LAMBDA,
              "nb_adapt_epochs": cfg.SOLVER.MAX_EPOCHS,
              "nb_init_epochs": cfg.SOLVER.MIN_EPOCHS,
              "init_lr": cfg.SOLVER.BASE_LR,
              "batch_size": cfg.SOLVER.TRAIN_BATCH_SIZE,
              "optimizer": {
                  "type": cfg.SOLVER.TYPE,
                  "optim_params": {
                      "momentum": cfg.SOLVER.MOMENTUM,
                      "weight_decay": cfg.SOLVER.WEIGHT_DECAY,
                      "nesterov": cfg.SOLVER.NESTEROV,
                  },
              },
          },
          "data_params": {
              "dataset_group": cfg.DATASET.NAME,
              "dataset_name": cfg.DATASET.NAME
              + "_Target_"
              + cfg.DATASET.TARGET,
              "source": "_".join(cfg.DATASET.SOURCE)
              if cfg.DATASET.SOURCE is not None
              else None,
              "target": cfg.DATASET.TARGET,
              "size_type": cfg.DATASET.SIZE_TYPE,
              "weight_type": cfg.DATASET.WEIGHT_TYPE,
          },
      }
      return config_params
  
imports: from copy import deepcopy
  import torch
  from kale.embed.image_cnn import ResNet18Feature, SmallCNNFeature
  from kale.pipeline.multi_domain_adapter import create_ms_adapt_trainer
  from kale.predict.class_domain_nets import ClassNetSmallImage
label_desc: Use image node_id 1 for calling a global function with example usage: get_config(cfg) and returns: config_params