code: def get_config(cfg):
      """
      Sets the hyperparameter for the optimizer and experiment using the config file
      Args:
          cfg: A YACS config object.
      """
      config_params = {
          "train_params": {
              "init_lr": cfg.SOLVER.BASE_LR,
              "adapt_lr": cfg.SOLVER.AD_LR,
              "lr_milestones": cfg.SOLVER.LR_MILESTONES,
              "lr_gamma": cfg.SOLVER.LR_GAMMA,
              "max_epochs": cfg.SOLVER.MAX_EPOCHS,
              "optimizer": {
                  "type": cfg.SOLVER.TYPE,
                  "optim_params": {
                      "momentum": cfg.SOLVER.MOMENTUM,
                      "weight_decay": cfg.SOLVER.WEIGHT_DECAY,
                  },
              },
          },
          "data_params": {
              "num_classes": cfg.DATASET.NUM_CLASSES,
          },
          "cnn_params": {
              "conv_layers_spec": cfg.CNN.CONV_LAYERS,
              "activation_fun": cfg.CNN.ACTIVATION_FUN,
              "use_batchnorm": cfg.CNN.USE_BATCHNORM,
              "pool_locations": cfg.CNN.POOL_LOCATIONS,
          },
          "transformer_params": {
              "cnn_output_shape": cfg.CNN.OUTPUT_SHAPE,
              "num_layers": cfg.TRANSFORMER.NUM_LAYERS,
              "num_heads": cfg.TRANSFORMER.NUM_HEADS,
              "dim_feedforward": cfg.TRANSFORMER.DIM_FEEDFORWARD,
              "dropout": cfg.TRANSFORMER.DROPOUT,
              "output_type": cfg.TRANSFORMER.OUTPUT_TYPE,
          },
      }
  
      return config_params
  
file_path: pykale/examples/cifar_cnntransformer/model.py
imports: from copy import deepcopy
  import torch
  import torch.nn
  from kale.embed.attention_cnn import CNNTransformer, ContextCNNGeneric
  from kale.embed.image_cnn import SimpleCNNBuilder
  from kale.pipeline.base_nn_trainer import CNNTransformerTrainer
  from kale.predict.class_domain_nets import ClassNet
label_desc: Use image node_id 1 for calling a global function with example usage: get_config(cfg) and returns: config_params