code: def update_config_by_rules(
      problem_type: str,
      config: DictConfig,
  ):
      """
      Modify configs based on the need of loss func.
      Now it support changing the preprocessing of numerical label into Minmaxscaler while using BCEloss.
  
      Parameters
      ----------
      problem_type
          The type of the problem of the project.
      config
          The config of the project. It is a Dictconfig object.
  
      Returns
      -------
      The modified config.
      """
      loss_func = OmegaConf.select(config, "optimization.loss_function")
      if loss_func is not None:
          if problem_type == REGRESSION and "bce" in loss_func.lower():
              # To use BCELoss for regression problems, need to first scale the labels.
              config.data.label.numerical_label_preprocessing = (
                  "minmaxscaler"
              )
  
      return config
  
imports: import copy
  import logging
  import os
  import re
  import warnings
  from typing import Callable, Dict, List, Optional, Tuple, Union
  from omegaconf import DictConfig, OmegaConf
  from packaging import version
  from torch import nn
  from ..constants import AUTOMM, DATA, FT_TRANSFORMER, FUSION_TRANSFORMER, HF_MODELS, MODEL, REGRESSION, VALID_CONFIG_KEYS
  from ..presets import get_automm_presets, get_basic_automm_config
  from .data import get_detected_data_types
label_desc: Use image node_id 12 for calling a global function with example usage: update_config_by_rules(problem_type, config) and returns: config